Watch tutorials and explanations by expert teachers that walk through solving this problem.
Algorithms for Big Bucks
Coding with Minmer
The TryIt Project
SDE Skills
Math Geeks
Elite Code
H William Polenz
Programming Live with Larry
ExtremeProgrammer
Solve more problems to master this pattern