Sum the odd and even in two variables, and just compare it
IntuitionApproachComplexity
Time complexity:

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

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```javascript []
/**
 * @param {string} num
 * @return {boolean}
 */
var isBalanced = function(num) {
     let sumEvenIndex = 0;
   let sumOddIndex = 0;
   for(let i =0; i < num.length; i++){
       if(i % 2 == 0){
           sumEvenIndex += parseInt(num[i]);
       } else{
          sumOddIndex += parseInt(num[i]);
       } 
       }
       if(sumEvenIndex == sumOddIndex) return true;
       return false;
    //   console.log("sum",sumEvenIndex,sumOddIndex)
};
```
['JavaScript']