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 — Permutations Visualizer & Solution | Rulcode

Fetching algorithms...

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

    42. Permutations

    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, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
    Explanation: All possible orderings of the numbers 1, 2, and 3 are generated.

    Example 2:

    Input: nums = [0, 1]
    Output: [[0, 1], [1, 0]]
    Explanation: All possible orderings of the numbers 0 and 1 are generated.

    Example 3:

    Input: nums = [1]
    Output: [[1]]
    Explanation: The only possible ordering of the number 1 is itself.

    Constraints:

    • •
    • •
    • •

    Time Complexity

    O(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.