GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • rulcode
  • Sign In

This view

  • Original page
  • New address

GeezerVison is showing rulcode.com — Subsets Visualizer & Solution | Rulcode

Fetching algorithms...

    Subsets Visualizer & Solution | Rulcode
    Loading problem details...

    41. Subsets

    Medium
    Topics
    Hint

    Understand Before Coding

    Visualize This Problem
    Open Visualizer
    Draw Your Approach
    Draw

    Example 1:

    Input: nums = [1, 2, 3]
    Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
    Explanation: The input array has three elements. The output lists all the 8 possible subsets: the empty set, single-element subsets, two-element subsets, and the subset containing all three elements.

    Example 2:

    Input: nums = [0]
    Output: [[],[0]]
    Explanation: The input array has one element. The output lists the two possible subsets: the empty set and the subset containing only the element 0.

    Constraints:

    • •
    • •
    • •

    Time Complexity

    O(2^n)

    Space Complexity

    O(n)

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.