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