You are given a string
num
consisting of only digits. A string of digits is called balanced if the sum of the digits at even indices is equal to the sum of digits at odd indices.Return
true
ifnum
is balanced, otherwise returnfalse
.
1 | package main |