solve combinations, remove duplicates from sorted list and sort colors