Practice · 7 of 8
Count Numbers With Property
CHALLENGE
Difficulty: advanced+25 XP
**Tình huống.** Given N ≤ 10^18, count the integers in [1, N] whose decimal digits are non-decreasing (e.g. 1259 yes, 129 no). **Thuật toán nào phù hợp nhất? Chương trình chỉ cần in ra chữ cái.** **A)** Sieve up to N (impossible memory) **B)** Iterate and check each number up to N **C)** Digit DP over the decimal representation of N **D)** Two pointers over digits
Press Submit to check your solution.
Back to lesson: Practice: Recognition Drill Set 1