Water Sort Game

Water Sort Game

In Water Sort game you are given a sequence of flasks. Most of them are filled with mixed liquids of different colors, and some are empty. Your task is to collect liquids of the same color in one flask using empty flasks by pouring a single color portion(s) from one flask to another with this color on top or to empty one.

example

The sequence of flasks is represented as list of strings. All non-empty flasks in a sequence have the same capacity (which may vary from test to test). Colors of liquids are encoded by latin letters from top to bottom (in flasks) and from leftest to rightest flask in order of first appearance (the first color is encoded as "a", the next distinct color - "b" etc). Adjacent portions of the same color encoded with repeating letter ("aa",...

You should be an authorized user in order to see the full description and start solving this mission.