Remove recurring digits
Submissions: 1631   Accuracy:

34.43%

  Difficulty: Basic   Marks: 1

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

Input:
The first line of input contains an integer T denoting the number of test cases. T testcases follow. Each testcase contains 1 line of input denoting the number N.

Output:
Print the number after removing recurring digits.

Constraints:
1 ≤ T ≤ 30
0 ≤ N < 1018

Example:
Input:
3
200
122
055

Output:
20
12
5

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

Author: kartik


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.



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


to report an issue on this page.