java.lang.Object
g0401_0500.s0491_increasing_subsequences.Solution

public class Solution extends java.lang.Object
491 - Increasing Subsequences.

Medium

Given an integer array nums, return all the different possible increasing subsequences of the given array with at least two elements. You may return the answer in any order.

The given array may contain duplicates, and two equal integers should also be considered a special case of increasing sequence.

Example 1:

Input: nums = [4,6,7,7]

Output: [[4,6],[4,6,7],[4,6,7,7],[4,7],[4,7,7],[6,7],[6,7,7],[7,7]]

Example 2:

Input: nums = [4,4,3,2,1]

Output: 4,4

Constraints:

  • 1 <= nums.length <= 15
  • -100 <= nums[i] <= 100
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    java.util.List<java.util.List<java.lang.Integer>>
    findSubsequences(int[] nums)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • findSubsequences

      public java.util.List<java.util.List<java.lang.Integer>> findSubsequences(int[] nums)