1234 and 50 are balanced, while 135 and 2468 are not.
You are given a positive integer start. Return the smallest balanced number that is greater than or equal to start.start=7 → 10
A one-digit number can never be balanced. The first fit is 10: one odd digit (1) and one even digit (0).
start=4521 → 4521
4521 has two even digits (4, 2) and two odd ones (5, 1), so it is already balanced.
start=888 → 1001
No three-digit number works, and the first balanced four-digit number is 1001.
start=7
10
Run checks the first 3 tests in your browser. Submit checks all 65 tests on the server, hidden ones included.