[LeetCode][Python3] 78. Subsets
2019. 1. 13. 21:06 |
프로그래밍/LeetCode
Problem :
https://leetcode.com/problems/subsets/
My Solution :
class Solution:
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
ret = []
def find(subset, remain):
if remain:
find(subset + remain[:1], remain[1:])
find(subset, remain[1:])
else:
ret.append(subset)
find([], nums)
return ret
'프로그래밍 > LeetCode' 카테고리의 다른 글
[LeetCode][Python3] 75. Sort Colors (0) | 2019.01.24 |
---|---|
[LeetCode][Python3] 102. Binary Tree Level Order Traversal (0) | 2019.01.22 |
[LeetCode][Python3] 230. Kth Smallest Element in a BST (0) | 2019.01.15 |
[LeetCode][Python3] 454. 4Sum II (1) | 2019.01.13 |
[LeetCode][Python3] 238. Product of Array Except Self (0) | 2019.01.12 |
[LeetCode][Python3] 347. Top K Frequent Elements (0) | 2019.01.05 |
[LeetCode][Python3] 94. Binary Tree Inorder Traversal (1) | 2019.01.03 |
[LeetCode][Python3] 62. Unique Paths (6) | 2018.11.15 |
최근에 달린 댓글 최근에 달린 댓글