Tap here to switch tabs
Problem
Submissions

Problem: Minimum Subsequence in Non-Increasing Order

med
30 min
Try to solve the Minimum Subsequence in Non-Increasing Order problem.

Statement

Given an integer array nums, obtain a subsequence such that the total sum of its elements is strictly greater than the sum of all elements not included in the subsequence.

If multiple such subsequences exist, return one with the minimum number of elements. If multiple minimum size subsequences satisfy the condition, return the one with the maximum total sum.

The resulting subsequence must be returned in non increasing order.

Note: A subsequence of an array is a sequence that can be derived from the array by deleting zero or more elements without changing the order of the remaining elements.

Constraints:

  • 1≤1 \leq nums.length ≤500\leq 500

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Subsequence in Non-Increasing Order

med
30 min
Try to solve the Minimum Subsequence in Non-Increasing Order problem.

Statement

Given an integer array nums, obtain a subsequence such that the total sum of its elements is strictly greater than the sum of all elements not included in the subsequence.

If multiple such subsequences exist, return one with the minimum number of elements. If multiple minimum size subsequences satisfy the condition, return the one with the maximum total sum.

The resulting subsequence must be returned in non increasing order.

Note: A subsequence of an array is a sequence that can be derived from the array by deleting zero or more elements without changing the order of the remaining elements.

Constraints:

  • 1≤1 \leq nums.length ≤500\leq 500

  • 1≤1 \leq nums[i] ≤100\leq 100