Problem Description
You are given an array of 0s and 1s in random order. Segregate 0s on left side and 1s on right side of the array [Basically you have to sort the array]. Traverse array only once.
1<=|A|<=1e6
a=[0 1 0]
Input 2:
A=[1 1 0 ]
[0 0 1]
Ouput 2:
[0 1 1]
above is sorted array.
Explanation 2:
sort the array.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.