Watch tutorials and explanations by expert teachers that walk through solving this problem.
TheGrayMind
Codechef Starters 64
Learn to Code
CyCode
The Nerd Coder
ExpertFunda
LetsCode
Solve more problems to master this pattern