Javascript Limit Array Size Python Interview