K Largest Elements

easy
1. You will be given an Array with its length
 2. You will also be given an integral value k
 3. You need to find k largest elements from the given array
 4. Input is handled for you
 5. It is a functional problem ,please do not modify main()

Input Format

Input is handled for you

Output Format

Output MUST be in descending order

Constraints

1 <= N <= 100
 K <= N
 -1000 <= C[i] <= 1000

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
8
44 -5 -2 41 12 19 21 -6 
2
Output
44 41
Next
Highest Frequency Character

Related Questions