BEATS 99.5% || MOST OPTIMIZED SOLUTION IN JAVA
\n# Code\njava []\nclass Solution \n{\n    public boolean isBalanced(String num) \n    {\n        int n = num.length();\n        int even = 0;\n        int odd 
\n# Code\n```java []\nclass Solution \n{\n    public boolean isBalanced(String num) \n    {\n        int n = num.length();\n        int even = 0;\n        int odd = 0;\n        for(int i=0;i<n;i++)\n        {\n            if(i % 2 == 0)\n            {\n                even += (num.charAt(i)-\'0\');\n            }\n            else\n            {\n                odd += (num.charAt(i)-\'0\');\n            }\n        }\n        return (odd==even);\n    }\n}\n```
['String', 'Java']