Javascript Array Shift Time Complexity In Python For All Selected Lines