Easy 2 Ways | Sum | Difference | C++
1. Sum Approach \n\nTime Complexity - O(N)\nSpace Complexity - O(1)\n\n\nclass Solution {\npublic:\n    bool isBalanced(string num) {\n        int odd = 0, even
### 1. Sum Approach \n\n*Time Complexity - O(N)*\n*Space Complexity - O(1)*\n\n```\nclass Solution {\npublic:\n    bool isBalanced(string num) {\n        int odd = 0, even = 0;\n        for(int i=0;i<num.length();i++) {\n            if(i%2 == 0) {\n                even += (num[i]-\'0\');\n            } else {\n                odd += (num[i]-\'0\');\n            }\n        }\n        return odd==even;\n    }\n};\n```\n\n### 2. Difference Approach\n\n*Time Complexity - O(N)*\n*Space Complexity - O(1)*\n\n```\nclass Solution {\npublic:\n    bool isBalanced(string num) {\n        int diff = 0;\n        for(int i=0;i<num.length();i++) {\n            if(i%2 == 0) {\n                diff += (num[i]-\'0\');\n            } else {\n                diff -= (num[i]-\'0\');\n            }\n        }\n        return diff==0;\n    }\n};\n```
['Math', 'String', 'C', 'Iterator']