remove duplicates from sorted array
color sort
generate parentheses