Javascript Limit Array Size Python Interview Programs