#3791
Number of Balanced Integers in a Range
master · 1860 · lc hard +32 · 34.9% accepted · 44 likes · top 13%
Description
Given two integers low and high, count how many integers in the inclusive range [low, high] are balanced, where a balanced integer has at least two digits and the sum of digits at odd positions equals the sum of digits at even positions (the leftmost digit is at position 1).
Code
1
2
3