https://pradeepbarman114.medium.com/solve-me-first-hackerrank-algorithms-solution-javascript-0d35ae1a10c8