<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution : <EOL> def subsetsWithDup ( self , S ) : <EOL> """<STR_LIT>""" <EOL> S . sort ( ) <EOL> result = [ ] <EOL> self . get_subset ( S , [ ] , result ) <EOL> return result <EOL> def get_subset ( self , S , current , result ) : <EOL> result . append ( current ) <EOL> for ind , val in enumerate ( S ) : <EOL> if ind - <NUM_LIT:1> >= <NUM_LIT:0> and val == S [ ind - <NUM_LIT:1> ] : <EOL> continue <EOL> self . get_subset ( S [ ind + <NUM_LIT:1> : ] , current + [ val ] , result ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> print Solution ( ) . subsetsWithDup ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) </s>
