Array Count Same Values Javascript Interview Question