We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It is valid untill you can find a subsequence in increasing order. In your example it is still possible to select {1,2} subsequence from array. The invalid array will be [2,1,1,1], because there is no "1" before "2", so you can't select increasing subsequence.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Longest Increasing Subsequence Arrays
You are viewing a single comment's thread. Return to all comments →
It is valid untill you can find a subsequence in increasing order. In your example it is still possible to select {1,2} subsequence from array. The invalid array will be [2,1,1,1], because there is no "1" before "2", so you can't select increasing subsequence.