Watch tutorials and explanations by expert teachers that walk through solving this problem.
Greg Hogg
NeetCodeIO
codingMohan
Prakhar Agrawal
CODE with Rahul.
GeeksforGeeks Practice
TechWithSaumya
Solve more problems to master this pattern