Watch tutorials and explanations by expert teachers that walk through solving this problem.
leetuition
Programming Live with Larry
Algorithms Casts
Elite Code
Tony Teaches
Online Judge Ninja
AlgoDuo
LetsCode
Solve more problems to master this pattern