Hackerrank : Codesprint practice