You are viewing a single comment's thread. Return to all comments →
Run time is O(n^2)
But optimize solution can solve this in O(n) time.
Here is the video explaination- https://youtu.be/f6bTIsj9ne8
and you can find most of the hackerrank solutions with video explaination here- https://github.com/Java-aid/Hackerrank-Solutions