K Largest Element
The first line of the input contains an integer ‘T’ denoting the number of test cases. The first line of each test case contains two space-separated positive integers ‘N’ and ‘K’ denoting the number of the elements present in the array and count of the largest elements you need to return as the answer respectively. The second line of each test case contains ‘N’ space-separated integers denoting the elements of the array.
The only line of output of each test case should contain ‘K’ largest elements in the array in non-decreasing order. Print the output of each test case in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
Can you solve this in less than O(N*log(N)) time complexity?
1 <= T <= 100 1 <= N <= 10^4 1<= K <= N -10^9 <= ARR[i] <= 10^9 Where ‘T’ is the number of test cases, ‘N’ is the size of the array, ‘K’ is the number of elements you need to return as an answer and ARR[i] is the size of the array of elements. Time Limit: 1 sec
Search In A Sorted 2D Matrix
Ninja And The Strictly Increasing Array
Negative To The End
Sort 0s, 1s, 2s
Fake Coin Problem