Apple Interview Question

Dutch flag algorithm related problem