Let's do it: [0, 1, 1, 1, 1] 010 phase done: [0, 1, 1, 1, 1] tmpstr 111 i 0 tmpstr 111 i 1 tmpstr2 110 (-110) Now: [1, 1, 1] 4 1 1 1 1