Watch tutorials and explanations by expert teachers that walk through solving this problem.
Programming Live with Larry
Code-Yao
vanAmsen
Elite Code
LetsCode
Think-Twice-Code-Once
Solve more problems to master this pattern