Created
October 20, 2022 02:33
-
-
Save RakhmedovRS/a64ac9609e188cc9f7788d89cf25ff34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int pos = max; | |
| int[] answer = new int[k]; | |
| int i = 0; | |
| while (pos >= 0) { | |
| for (int value : buckets.get(pos)) { | |
| answer[i++] = value; | |
| if (i == k) { | |
| return answer; | |
| } | |
| } | |
| pos--; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment