Easy solution: Using one variable for sum instead of two.
IntuitionMy initial thought was to create two variables, even_sum and odd_sum, and then loop through the digits to calculate their respective sums.However, I re
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
My initial thought was to create two variables, even_sum and odd_sum, and then loop through the digits to calculate their respective sums.

However, I realized there is a simpler way to solve this. Instead of maintaining two separate variables, I could use a single variable, curr_sum. For even indices, I would add the digit to curr_sum, and for odd indices, I would subtract the digit. If the final result of curr_sum is 0, the number is balanced; otherwise, it is not.
# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def isBalanced(self, num: str) -> bool:
        curr_sum = 0

        for val in range(len(num)):
            if val % 2 == 0:
                curr_sum += int(num[val])
            else:
                curr_sum -= int(num[val])

        return curr_sum == 0
```
['Python3']