Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCode
NeetCodeIO
Nick White
Coding Decoded
Programmers Zone
Java Coding Insight Interview Preparation
Programming Live with Larry
Algorithms Casts
LeetCode Solution