Python solution
Intuition\n Describe your first thoughts on how to solve this problem. \nWe need to calculate the sum of elements at even and odd indices separately and check w
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe need to calculate the sum of elements at even and odd indices separately and check whether both sums are equal or not.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nSince we have to traverse through each position, I used a single variable to store the result. At each odd index, I have added the element to the currSum and at each even index, I have subtracted the element from the currSum. At the end, if the currSum is 0, then we can say the sum of elements at even and odd indices are equal, else they are different.\n\nNote: We can use two separate variables to store the sum of even indices and odd indices separately, but using one variable makes our life simple when comparing it with zero.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n\n# Code\n```python3 []\nclass Solution:\n    def isBalanced(self, num: str) -> bool:\n        currSum = 0\n        for i in range(len(num)):\n            if i%2:\n                currSum += int(num[i])\n            else:\n                currSum -= int(num[i])\n\n        return currSum == 0\n```
['Python3']