Given a string str containing lowercase characters, the task is to find the lexicographically largest sub-sequence of str.
Examples:
Input: str = %u201Cabc%u201D
Output: c
All possible sub-sequences are %u201Ca%u201D, %u201Cab%u201D, %u201Cac%u201D, %u201Cb%u201D, %u201Cbc%u201D and %u201Cc%u201D
and %u201Cc%u201D is the largest among them (lexicographically)Input: str = %u201Cgeeksforgeeks%u201D
Output: ss
Comments