Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint โ€” Digit Sums

โญ beginnerโณ 40 min read๐Ÿ“ Lesson 160 of 281

A heavy query load of exact-K digit-sum counts; the tight-flag drop that undercounts every boundary is the graded wrong answer.

Checkpoint โ€” Digit DP. Each line: L R K (read until EOF). Print, per line, the count of x in [L, R] with digit sum exactly K.

The tight flag is the entire difficulty: dropping it undercounts.