Watch tutorials and explanations by expert teachers that walk through solving this problem.
Greg Hogg
NeetCodeIO
Coding For Dummies
Coding Ninjas Webinars and Contest Editorials
Programming Live with Larry
Chris Ibe
LeetUp
Solve more problems to master this pattern