title: Rearranging Array Alternately[Memory Error]
body: <p>I try to solve a questions from geeksforgeeks.org on question about "Rearrange Array Alternately", when trying on the sample input, I did not receive any errors but when I try to submit it then i receive "memory Error"</p>
  
  <pre><code>test_cases = "1"
  for _ in range(int(test_cases)):
      new_array = []
      array_size = int("89")
      array = list(map(int, "1 9 16 18 72 88 98 100 127 128 150 155 160 174 185 196 198 200 218 226 267 270 279 284 299 309 326 335 335 351 355 369 383 394 399 400 413 422 422 429 438 440 446 483 507 529 529 542 553 556 567 571 578 594 611 640 642 652 658 658 663 673 694 717 723 736 762 763 775 777 778 784 806 816 828 851 853 854 889 891 911 932 953 955 958 973 977 986 998 ".split()))
      while len(array) != 0:
          if len(array) == 1:
              new_array.append(array[0])
              array.remove(array[0])
          else:
              max_array_value = max(array)
              min_array_value = min(array)
              new_array.append(max_array_value)
              new_array.append(min_array_value)
              array.remove(max_array_value)
              array.remove(min_array_value)
  </code></pre>
  
  <p>*Side notes: Lets just ignore why I use it in string format and not integer due to me trying to replicate the input from geeksforgeeks.org. *</p>
  
  <p>The current codes work only on the small array but not a very large array. When I try to create a list of more than 100 integers then it will give me the error. I am wondering whether is there any work around for solving such a problem?</p>