Watch tutorials and explanations by expert teachers that walk through solving this problem.
NAGE FOREX
take U forward
Umar Ashraf
Tushar Roy - Coding Made Simple
Greg Hogg
NeetCode
Techdose
Solve more problems to master this pattern