<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution ( object ) : <EOL> def reverseWords ( self , s ) : <EOL> """<STR_LIT>""" <EOL> self . reverse ( s , <NUM_LIT:0> , len ( s ) ) <EOL> i = <NUM_LIT:0> <EOL> while i < len ( s ) : <EOL> j = i + <NUM_LIT:1> <EOL> while j < len ( s ) and s [ j ] != "<STR_LIT:U+0020>" : <EOL> j += <NUM_LIT:1> <EOL> self . reverse ( s , i , j ) <EOL> i = j + <NUM_LIT:1> <EOL> def reverse ( self , s , start , end ) : <EOL> i = start <EOL> j = end <EOL> while i < j - <NUM_LIT:1> : <EOL> s [ i ] , s [ j - <NUM_LIT:1> ] = s [ j - <NUM_LIT:1> ] , s [ i ] <EOL> i += <NUM_LIT:1> <EOL> j -= <NUM_LIT:1> <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> lst = list ( "<STR_LIT>" ) <EOL> Solution ( ) . reverseWords ( lst ) <EOL> assert "<STR_LIT>" . join ( lst ) == "<STR_LIT>" </s>
