Google interview question

Various methods to sort colours