Skip to main content
📜 WAYPOINT LESSON

Checkpoint — Recursion

⭐ beginner⏳ 15 min read📍 Lesson 39 of 281

Pass the graded problem to finish the recursion module.

Checkpoint — đệ quy. Pass the graded challenge below. The insight is that f(n) collapses to at most 3 steps for any 64-bit n (the first sum is at most 9*19 = 171, and numbers below 172 finish fast), so a plain loop per query is already optimal — the recursive thinking derives that bound. The near-miss is treating "0" and single digits as needing one step.

Điểm kiểm tra — đệ quy. Pass bài chấm bên dưới. Điểm mấu chốt: f(n) gọn về tối đa 3 bước với mọi n 64 bit (lần cộng đầu tối đa 9*19 = 171, và số dưới 172 kết thúc rất nhanh), nên một vòng lặp thường mỗi truy vấn đã là tối ưu — tư duy đệ quy mới là thứ suy ra chặn trên đó. Near-miss kinh điển là coi "0" và số một chữ số cần một bước.