Hello everyone, Actually i recently studied LIS nlog(n) approach and tried SPOJ LIS2. It is running well on sample cases but giving WA at #1(don't know why??). Can someone please point out the mistake.. The link to my solution is http://ideone.com/ya5gsw .