Watch tutorials and explanations by expert teachers that walk through solving this problem.
Rikam Palkar
Math Geeks
LeetJS
Brogrammers
Coding Guys
ELeetCoder
rotrA
Chanakya Mantra
hornclause
Solve more problems to master this pattern