Watch tutorials and explanations by expert teachers that walk through solving this problem.
Timothy H Chang
Geekific
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