Let's do it: [1, 1, 0, 1] 010 phase done: [1, 1, 0, 1] tmpstr 101 i 0 i 1 tmpstr2 011 (-011) Now: [1, 1] 3 2 1 1