Largest number M less than N such that XOR of M and N is even | Function to find the maximum possible value of M ; Edge case ; M = N - 2 is maximum possible value ; Driver code
def getM ( n ) : NEW_LINE INDENT if ( n == 1 ) : NEW_LINE INDENT return - 1 ; NEW_LINE DEDENT else : NEW_LINE INDENT return n - 2 ; NEW_LINE DEDENT DEDENT n = 10 NEW_LINE print ( getM ( n ) ) NEW_LINE