BETA

Difficulty Level: Basic

Submissions: 1182 Accuracy:

37.31%

Remove recurring digits
     

Given a number, remove recurring digits from it. All adjacent same occurrences of a digit should be replaced by only 1 digit.  For example, 111222 should be converted to 12.

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N.

Output:

Print the number of remving recurring digits

Constraints:

1 ≤ T ≤ 30
1 ≤ N < 10^30

Example:

Input:
2
200
122

Output:
20
12

 

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.