arr [ i ] wants to be a potential condidate of future subsequence It will replace ceil value in tailIndices
pos = GetCeilIndex ( arr , tailIndices , - 1 , len - 1 , arr [ i ] ) NEW_LINE prevIndices [ i ] = tailIndices [ pos - 1 ] NEW_LINE tailIndices [ pos ] = i NEW_LINE print ( " LIS ▁ of ▁ given ▁ input " ) NEW_LINE i = tailIndices [ len - 1 ] NEW_LINE while ( i >= 0 ) : NEW_LINE print ( arr [ i ] , " ▁ " , end = " " ) NEW_LINE i = prevIndices [ i ] NEW_LINE print ( ) NEW_LINE return len NEW_LINE