Watch tutorials and explanations by expert teachers that walk through solving this problem.
take U forward
NeetCode
Nikhil Lohia
Algorithms Made Easy
Greg Hogg
Aryan Mittal
One Code Man
Solve more problems to master this pattern