Luke - checking whether string is balanced
IntuitionApproachI used two variables (odd and even). I used a for loop and if the indice is even, I add the value of the index to the even, otherwise, I do tha
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
I used two variables (odd and even). I used a for loop and if the indice is even, I add the value of the index to the even, otherwise, I do that for the odd. Finally, I check if even and odd are equal. If so, return true. Otherwise, return false.
# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(n)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public boolean isBalanced(String num) {
        int odd = 0;
        int even = 0;
        for (int i=0; i<num.length(); i++){
            if (i % 2 != 0){
                odd += Character.getNumericValue(num.charAt(i));
            }
            else{
                even += Character.getNumericValue(num.charAt(i));
            }
        }
        return odd == even;
    }
}
```
['Java']