Math Fundamentals18 sections · 814 units
Open in Course

Lessons from Perfect Squares

summary

Three points:

1.1. Sequences define the structure of choices in DP problems. Here, the sequence of perfect squares determines which transitions are valid.

2.2. Algebraic manipulation (solving k2ik^2 \leq i for kk) gives you loop bounds. This prevents checking invalid values.

3.3. Time complexity analysis uses summation formulas. The i=1ni\sum_{i=1}^{n} \sqrt{i} term approximates to O(nn)O(n \sqrt{n}).