Intel Corporation Interview Question

given an array with 3 colors of balls, sort it by going over the array only once