Question: Need help with python. Given a list of integers (positive and negative), write a function called arrange that uses a deque to arrange the elements
Given a list of integers (positive and negative), write a function called arrange that uses a deque to arrange the elements so the negative numbers occur before the positive numbers (note that the function doesn't sort the values). The function returns a new list containing the rearranged elements. For instance, for the input [-3, 12, 6, -7, -1, 8, the function would return [-1, -7, -3, 12, 6, 8]. Write a main function to test the function using various inputs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
