Function to find the required array
def findArray ( q , n ) : NEW_LINE INDENT arr = [ None ] * n NEW_LINE k = 0 NEW_LINE for j in range ( int ( n / 4 ) ) : NEW_LINE INDENT ans = q [ k ] ^ q [ k + 3 ] NEW_LINE arr [ k + 1 ] = q [ k + 1 ] ^ ans NEW_LINE arr [ k + 2 ] = q [ k + 2 ] ^ ans NEW_LINE arr [ k ] = q [ k ] ^ ( ( arr [ k + 1 ] ) ^ ( arr [ k + 2 ] ) ) NEW_LINE arr [ k + 3 ] = q [ k + 3 ] ^ ( arr [ k + 1 ] ^ arr [ k + 2 ] ) NEW_LINE k += 4 NEW_LINE DEDENT DEDENT