<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution ( object ) : <EOL> def missingNumber ( self , nums ) : <EOL> """<STR_LIT>""" <EOL> num_n = None <EOL> n = len ( nums ) <EOL> i = <NUM_LIT:0> <EOL> while i < n : <EOL> if nums [ i ] == n : <EOL> num_n = nums [ i ] <EOL> nums [ i ] = None <EOL> i += <NUM_LIT:1> <EOL> elif nums [ i ] is not None and nums [ i ] != i : <EOL> j = nums [ i ] <EOL> nums [ i ] , nums [ j ] = nums [ j ] , nums [ i ] <EOL> else : <EOL> i += <NUM_LIT:1> <EOL> if not num_n : <EOL> return n <EOL> return nums . index ( None ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> assert Solution ( ) . missingNumber ( [ <NUM_LIT:2> , <NUM_LIT:0> ] ) == <NUM_LIT:1> </s>
