Search
⌘K

Leetcode 3340. Check Balanced String

Given a numeric string, determine whether the sum of digits at even indices equals the sum at odd indices and return true if they match, otherwise false. This is solved by a single pass accumulating two sums (O(n) time, O(1) extra space).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.