The Cursed Substring
Count the integers in [L, R] whose decimal form CONTAINS the substring 13 (a 1 immediately followed by a 3).
Input: one line with two integers L and R.
Output: the count of integers containing '13'.
Constraints:
- 1 ≤ L ≤ R ≤ 1018
Sample Tests
Input 1
1 20
Output 1
1
Input 2
13 13
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.