Given an array nums and an integer k, return the most competitive subsequence of length k — the lexicographically smallest subsequence of that length (comparing element by element). The input is JSON {nums, k}.
Input: JSON {nums, k}.
Output: Array — the most competitive subsequence.
Input: {"nums":[3,5,2,6],"k":2}
Output: [2,6]
Explanation: Smallest length-2 subsequence.Input: {"nums":[2,4,3,3,5,4,9,6],"k":4}
Output: [2,3,3,4]
Explanation: Greedy smallest picks.Input: {"nums":[5],"k":1}
Output: [5]
Explanation: Only choice.1<=k<=n<=10^5