Created
August 30, 2020 15:57
-
-
Save trunkslamchest/80a9b8728f1878f0082f64bf4423c3fd to your computer and use it in GitHub Desktop.
blog30_tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test Case #1: | |
Input: nums = [4,3,10,9,8] | |
Output: [10,9] | |
Explanation: The subsequences [10,9] and [10,8] are minimal | |
such that the sum of their elements is strictly greater than the sum of elements not included, however, | |
the subsequence [10,9] has the maximum total sum of its elements. | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Test Case #2: | |
Input: nums = [4,4,7,6,7] | |
Output: [7,7,6] | |
Explanation: The subsequence [7,7] has the sum of its elements equal to 14 | |
which is not strictly greater than the sum of elements not included (14 = 4 + 4 + 6). | |
Therefore, the subsequence [7,6,7] is the minimal satisfying the conditions. | |
Note the subsequence has to returned in non-decreasing order. | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Test Case #3: | |
Input: nums = [6] | |
Output: [6] | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment