PrimeAnalytiq interview question

Maximum of 2 hours in a JavaScript Arrays looping