Hackerrank Javascript Practice