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