janengh69 / holland_flag_game Goto Github PK
View Code? Open in Web Editor NEW"The task of the Dutch flag". Along the board lay balls of three colors - red, blue, white. One move is allowed to change two different balls in places. To ensure that all the red balls were the first, in the middle - white, the last - the blue. If the total number of holes is n, then n-1 steps are enough to solve the problem.