0 ms Beats 100.00%
IntuitionApproachComplexity
Time complexity:O(n)

Space complexity:O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# 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
```cpp []
class Solution {
public:
    bool isBalanced(string num) {
        int s1=0,s2=0;
        for(int i=0;i<num.size();i++)
        {
            if(i%2==0)
                s1+=(num[i]-'0');
            else
                s2+=(num[i]-'0');
        }
        return s1==s2;
    }
};
```
['String', 'C++']