K Increasing Subsequence 2
Try First, Check Solution later1. 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.
For the given sequence A with n elements find the number of strictly increasing subsequences with k elements.Input Format
Note: This question is same as K Increasing Subsequence, but this time array can have numbers from 1 to 10^9 and can have duplicates.
First line contains two integer n and kOutput Format
following n lines contains elements of sequence
Print one number the andwer to questionQuestion Video
1. 1 <= n <= 10^5Sample Input
2. 1 <= k <= 11
3. 1 <= A[i] <= 10^9
5. A can contain duplicates
6. Output may not fit in 32 bit signed integer
5 2Sample Output
Asked in Companies