Search
⌘K

Leetcode 3627. Maximum Median Sum of Subsequences of Size 3

Partition the array into n/3 triplets and maximize the sum of their medians; the key insight is that after sorting you can greedily choose the k = n/3 medians by taking every second element starting from index k (indices k, k+2, …, 3k-2).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.