Javascript practice hackerrank