Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCode
Nick White
NeetCodeIO
Scott
Fisher Coder
The FinTech Club
Algorithms Casts
Abdullah Arshed
codewebindia
Solve more problems to master this pattern