LONGEST INCREASING SUBSEQUENCE

I actually did this Question using 1D array and tested with many test cases and it is accepting it
but on the online judge it is giving wrong answer
Can anyone please pin point where my code is going wrong

Question --> http://www.spoj.com/problems/ELIS/

My solution–> http://ideone.com/oC3Qad

Your code is giving wrong answer for following testcase:

10

3 4 5 2 4 6 7 8 2 10

your code is giving 8 (see here) but correct answer is 7 . LIS = {3,4,5,6,7,8,10}

1 Like

Thanks for the test case
need to think something else now

your welcome :slight_smile:

https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1346

//