#Given an array of 0s and 1s in random order.Segregate 0s on left side and 1s on right side of the array. ##Brute-force: Count 0s and rewrite array first with counted zeros then by 1 #Time-complexity:O(n),Auxiliary-space:O(1) ##Algorithm: Dutch National Flag Algorithm #Time-complexity:O(n),Auxiliary-space:O(1) def segregate(a) left=0 right=a.length-1 while left [0, 0, 0, 1, 1, 1]