Output is correct but some test cases are not passing

https://ide.codingblocks.com/s/240410… plz help

@dhirenkinha
these are the mistakes in your code

  1. line 11, iterate till i<n not i<=n;
  2. start with ans=1
  3. elements in subsequence should be strictly increasing. So change condition in line14 to if(arr[j]<arr[i]){

still those test cases are not passing

sir plz help with this

@dhirenkinha
Ok I am checking your code. Get back to you soon