Solution for this problem

https://hack.codingblocks.com/app/practice/1/1271/problem