-
1491. Average Salary Excluding the Minimum and Maximum Salary python javaLeetCode_Study_Plan/Programming Skills 2022. 9. 19. 20:20
https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary
Average Salary Excluding the Minimum and Maximum Salary - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
Java
import java.util.Arrays; class Solution { public double average(int[] salary) { int N = salary.length; Arrays.sort(salary); double sum = salary[1]; for (int i = 2; i < N - 1; i++) { sum += salary[i]; } return sum / (N - 2); } }
'LeetCode_Study_Plan > Programming Skills' 카테고리의 다른 글
976. Largest Perimeter Triangle java (0) 2022.09.19 1281. Subtract the Product and Sum of Digits of an Integer java (0) 2022.09.19 191. Number of 1 Bits java (1) 2022.09.19 1523. Count Odd Numbers in an Interval Range python java (1) 2022.09.19 [Programming Skills I] 시작 그리고 도전 (0) 2022.09.19