Challenge me, only one line except sort() line

  • 0
    class Solution:
        # @param S, a list of integer
        # @return a list of lists of integer
        def subsets(self, S):
            return [[S[j] for j in range(len(S)) if i & (1 << j)] for i in range(2**len(S))]

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.