Difference between sums of odd and even digits
Submissions: 3727   Accuracy:

19.96%

  Difficulty: Basic   Marks: 1

Given a long integer, we need to find if the difference between sum of digits present at the odd positions and sum of digits present at even positions is 0 or not. The indexes start from zero (0 index is for leftmost digit).

Input:
First line consists of T test cases. Only line of every test case consists of a number N.

Output:
Print "Yes" if difference is 0 else print "No".

Constraints:
1<=T<=300
1<=N<=1018

Example:
Input:

2
1212112
123
Output:
Yes
No

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

Contributor: Saksham Raj Seth
Author: saksham seth


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.