Watch tutorials and explanations by expert teachers that walk through solving this problem.
Kevin Naughton Jr.
Pepcoding
NeetCode
Amell Peralta
Aryan Mittal
Programming Live with Larry
Nan Liu
interviewBoost
Solve more problems to master this pattern