We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
minor point here but I keep getting a wrong score on case 16 (which does not show my output) -- running in visual studio I appear to be getting the correct result?
the range 0 to 145, i have the same lis (the smallest prefix) as the solution. at index 146, the testcase expects to take 6353 which is the smallest, has only 648 children and thus covers rank 1..648, that is not enough for k=1000. I take the next higher which is 6538 and covers rank 649..1296. I have verified for hours but can't find the error (index are 0-based). I even see the path the expected result goes, because I have found that sequence too with a lower rank tough (between 217 and 648). I cross-checked the code several times.
Could anybody verify this.
here are some details about test case 8:
- LIS length: 196
- # of LIS: 17'236'010'373'120
- sequence start: 38, 45, 96, 126, ..
- sequence end: 9385, 9483, 9579, 9650, 9776, 9835, 9948
Here is Super Kth LIS problem solution in Python Java C++ and C programming - https://programs.programmingoneonone.com/2021/07/hackerrank-super-kth-LIS-problem-solution.html
Haskel Solution
minor point here but I keep getting a wrong score on case 16 (which does not show my output) -- running in visual studio I appear to be getting the correct result?
testcase 8, can it be wrong:
the range 0 to 145, i have the same lis (the smallest prefix) as the solution. at index 146, the testcase expects to take 6353 which is the smallest, has only 648 children and thus covers rank 1..648, that is not enough for k=1000. I take the next higher which is 6538 and covers rank 649..1296. I have verified for hours but can't find the error (index are 0-based). I even see the path the expected result goes, because I have found that sequence too with a lower rank tough (between 217 and 648). I cross-checked the code several times.
Could anybody verify this.
here are some details about test case 8: - LIS length: 196 - # of LIS: 17'236'010'373'120 - sequence start: 38, 45, 96, 126, .. - sequence end: 9385, 9483, 9579, 9650, 9776, 9835, 9948