Watch tutorials and explanations by expert teachers that walk through solving this problem.
Algorithms Made Easy
Aryan Mittal
Fisher Coder
NeetCodeIO
Sai Anish Malla
Programming Live with Larry
DeepCodes
Prakhar Agrawal
Solve more problems to master this pattern