Watch tutorials and explanations by expert teachers that walk through solving this problem.
Sahil & Sarra
CrioDo
take U forward
NeetCodeIO
Greg Hogg
The Code Skool
Shiran Afergan
Alex Nguyen
Solve more problems to master this pattern