Solved! Leetcode 491: Non-decreasing Subsequences

https://leetcode.com/problems/non-decreasing-subsequences/description/

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

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]]

Rate this post

Leave a Reply