LAS [ i ] [ pos ] array to find the length of LAS till index i by including or excluding element arr [ i ] on the basis of value of pos
int LAS [ 1000 ] [ 2 ] = { false } ; int solve ( int arr [ ] , int n , int i , bool pos ) {