answer of hackerrank aug contest q1