Youtube playlist for more coding challenge like this:https://www.youtube.com/watch?v=jzVoFUwlMZg&list=PL13Vva6TJcSsZtUipeopvYnNd0zzg4wbT
Github Code Repository for coding challenge: https://github.com/premaseem/AlgoAndDataStructureInJava/tree/master/src/codechallenge
For details visit: https://premaseem.wordpress.com/category/coding-challenge/
If you have a better/ different solution, please share your solution in the comment.