Tap here to switch tabs
Problem
Submissions

Problem: Maximum Median Sum of Subsequences of Size 3

Try to solve the Maximum Median Sum of Subsequences of Size 3 problem.

Statement

You are given an integer array nums whose length is a multiple of 33.

In each step, you select any 33 elements from nums, determine the median of these 33 elements, and remove them from nums. You repeat this process until nums is empty.

Return the maximum possible sum of the medians of all selected triplets.

Note: The median of 33 numbers is the value located in the middle when the numbers are sorted in nondecreasing order.

Constraints:

  • 1≤1 \leq nums.length ≤5imes105\leq 5 imes 10^5

  • nums.length \\% 3 = 0

  • 1≤1 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Median Sum of Subsequences of Size 3

Try to solve the Maximum Median Sum of Subsequences of Size 3 problem.

Statement

You are given an integer array nums whose length is a multiple of 33.

In each step, you select any 33 elements from nums, determine the median of these 33 elements, and remove them from nums. You repeat this process until nums is empty.

Return the maximum possible sum of the medians of all selected triplets.

Note: The median of 33 numbers is the value located in the middle when the numbers are sorted in nondecreasing order.

Constraints:

  • 1≤1 \leq nums.length ≤5imes105\leq 5 imes 10^5

  • nums.length \\% 3 = 0

  • 1≤1 \leq nums[i] ≤109\leq 10^9