Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCodeIO
Code with Alisha
vanAmsen
Programming Live with Larry
Gantavya Malviya
CodingNinja
Elite Code
KNuggies
Solve more problems to master this pattern