Given a string which includes characters a, b, c, ..., z. Where value of a=1, b=2, ..., z=26. Now find the largest increasing sub sequence in the string and print it's length.
Note: Sub sequence doesn't require elements to be consecutively increasing.
The first line contains a single integer T i.e. the number of test cases. The first and the only line of each test case consists of a string S.
In one line print the length of the largest increasing sub sequence in the string.
1<=|Length of String|<=1000
Test Case 2: The length of largest increasing subsequence is 6. One of the sequence with max length 6 is a, b, c, d, p, z.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.