limit. A ticket is lucky when the digits of its number add up to an even value.
Return how many lucky tickets there are among the numbers 1 through limit inclusive.limit=12 → 5
The numbers 2, 4, 6, 8 and 11 have an even digit sum, five in total.
limit=1 → 0
The digit sum of 1 is odd, so no ticket qualifies.
limit=25 → 12
2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22 and 24 qualify, which is 12 tickets.
limit ≤ 1000limit=12
5
Run checks the first 3 tests in your browser. Submit checks all 37 tests on the server, hidden ones included.