Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCodeIO
happygirlzt
Deepti Talesra
Cracking FAANG
CppNuts
Everyday Data Science
50ShadesofDSA
Codinity
Solve more problems to master this pattern