Second state which does not include current index
ans = max ( ans , findLongest ( a , n , present + 1 , previous ) ) ; } else { int h1 = a [ previous ] . first ; int h2 = a [ present ] . first ; int w1 = a [ previous ] . second ; int w2 = a [ present ] . second ;