backtracking
even . append ( x ) NEW_LINE if ( len ( odd ) != 0 ) : NEW_LINE x = odd [ len ( odd ) - 1 ] NEW_LINE odd . remove ( odd [ len ( odd ) - 1 ] ) NEW_LINE v [ i ] = x NEW_LINE parity ( even , odd , v , i + 1 ) NEW_LINE