<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution : <EOL> def combinationSum ( self , candidates , target ) : <EOL> """<STR_LIT>""" <EOL> candidates . sort ( ) <EOL> result = [ ] <EOL> self . get_combination ( target , candidates , [ ] , result ) <EOL> return result <EOL> def get_combination ( self , target , candidates , current , result ) : <EOL> if not candidates or sum ( current ) > target : <EOL> return <EOL> if sum ( current ) == target : <EOL> result . append ( current ) <EOL> return <EOL> for ind , val in enumerate ( candidates ) : <EOL> self . get_combination ( target , candidates [ ind : ] , current + [ val ] , result ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> print Solution ( ) . combinationSum ( [ <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:6> , <NUM_LIT:7> ] , <NUM_LIT:7> ) </s>
