Repository navigation
Add Kth Largest Element problem (Heaps) - #54
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTNCBT8dJKatDtYhD26XwJ
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
|
Autopilot could not be updated. Open Coding to check access and billing. |
…-element # Conflicts: # src/main/java/com/example/onlinejava/problem/ProblemRegistry.java # src/test/java/com/example/onlinejava/problem/ProblemRegistryTest.java
|



Summary
findKthLargest(int[] numbers, int k)returns the kth largest value (k = 1 is the largest), with duplicates counted individually.KthLargestElementProbleminProblemRegistryalongside the existing problems.src/test/resources/solutions/kth-largest-element.txt(min-heap of size k) andkth-largest-element.wrong.txt(returns the kth smallest via sorting, which fails multiple hidden tests on purpose).ProblemRegistryTest'shasSize(...)assertion from 8 to 9 registered problems.Only these files were touched: the new problem class,
ProblemRegistry.java, the two solution files, andProblemRegistryTest.java.Test plan
Ran the scoped, Docker-free validation command (also runs Checkstyle in Maven's
validatephase):The repo's own CI (
.github/workflows/ci-cd.yml) will independently re-run the full suite against a real Postgres container before merge is possible.Opened automatically by a scheduled cloud agent (every 2 hours), not auto-merged -- please review.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GTNCBT8dJKatDtYhD26XwJ
Generated by Claude Code