Skip to content
This repository was archived by the owner on Apr 27, 2025. It is now read-only.

Commit 5cd69a6

Browse files
authored
Update 78-Subsets.md
1 parent a76cc14 commit 5cd69a6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

78-Subsets.md

+17
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ class Solution {
4848
}
4949
}
5050
```
51+
52+
53+
```swift
54+
class Solution {
55+
func subsets(_ nums: [Int]) -> [[Int]] {
56+
var result = [[Int]].init([[]])
57+
for n in nums {
58+
for i in 0..<result.count {
59+
var temp = result[i]
60+
temp.append(n)
61+
result.append(temp)
62+
}
63+
}
64+
return result
65+
}
66+
}
67+
```

0 commit comments

Comments
 (0)