one more hackerrank problem

Still testing it against testcases