Skip to content

Commit ebde336

Browse files
authored
Create Maximum Median Sum of Subsequences of Size 3.java
1 parent 9a3fcff commit ebde336

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public long maximumMedianSum(int[] nums) {
3+
Arrays.sort(nums);
4+
long sum = 0;
5+
int n = nums.length;
6+
for (int i = n / 3; i < n; i += 2) {
7+
sum += (long) nums[i];
8+
}
9+
return sum;
10+
}
11+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy