02.03 · Problem
Subsets
Given distinct numbers, return every subset, including the empty one and the full one. Any order is fine.
Examples
Example 1
Input: nums = [1, 2, 3]
Output: [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
Example 2
Input: nums = [0]
Output: [[], [0]]solulu Pro
Continue this problem with Pro
Inside: step-by-step hints · 8 hidden tests · reference solutions · code editor.
Lifetime ₹1,999 ₹999 · Launch offer
Item 14 of 44 · updated 2026-10-13