Algorithm · Oracle · Medium
You are given an integer list nums and an integer k. Find the k unique values in nums that occur most frequently. Order the selected values so that a value with a larger frequency comes earlier. When two selected values have equal frequency, place the larger numeric value first. Input Format The first line contains two integers: n and k. The second line contains n integers that form nums. Output Format Print the k selected integers on one line, separated by spaces. Example…
Checking your access…