c++ solution
\nclass Solution {\npublic:\n    bool isBalanced(string num) {\n        int n=num.size();\n        int sum=0;\n        for(int i=0;i<n;i++){\n            if(i&1
```\nclass Solution {\npublic:\n    bool isBalanced(string num) {\n        int n=num.size();\n        int sum=0;\n        for(int i=0;i<n;i++){\n            if(i&1){\n                sum-=(num[i]-\'0\');\n            }\n            else{\n                sum+=(num[i]-\'0\');\n            }\n        }\n        return sum==0;\n    }\n};\n```
['C', 'C++']