Stores the count of elements in decreasing order in Bitonic subsequence
ct2 = lds [ inx ] - 1 NEW_LINE i = inx NEW_LINE while i < N and ct2 > 0 : NEW_LINE INDENT if lds [ i ] == ct2 : NEW_LINE INDENT res . append ( arr [ i ] ) NEW_LINE ct2 -= 1 NEW_LINE DEDENT i += 1 NEW_LINE DEDENT