Lexicographically Smallest Subsequence
medium
1. Given an integer array nums and a positive integer k; 2. return the lexicographically smallest subsequence of size k;
Constraints
1. 1 <= nums.length <= 10^5 2. 1 <= nums[i] <= 10^9 3. 1 <= k <= nums.length
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
8
2
4
3
3
5
4
9
6
4
Sample Output
4
2
3
3
4
Question Video