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