Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCode
Ashish Pratap Singh
NeetCodeIO
stoney codes
Sahil & Sarra
Dave Burji
E for EXPLORER
Garrett Codes
Sajjaad Khader
Solve more problems to master this pattern