This questions has many solutions but this one is the most efficient as the time complexity is O(n)
No download links available.