Hackerearth Javascript Test