Watch tutorials and explanations by expert teachers that walk through solving this problem.
The Code Mate
Timothy H Chang
KeyStrokes
Persistent Programmer
Matt Guest
Programming Live with Larry
CS for Normal People
Josh's DevBox
Depth First
Solve more problems to master this pattern