Skip to content

Commit a2a1eb4

Browse files
committed
Added README.md file for Average Salary Excluding the Minimum and Maximum Salary
1 parent 6134989 commit a2a1eb4

File tree

1 file changed

+31
-0
lines changed
  • 1584-average-salary-excluding-the-minimum-and-maximum-salary

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<h2><a href="https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary">Average Salary Excluding the Minimum and Maximum Salary</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>You are given an array of <strong>unique</strong> integers <code>salary</code> where <code>salary[i]</code> is the salary of the <code>i<sup>th</sup></code> employee.</p>
2+
3+
<p>Return <em>the average salary of employees excluding the minimum and maximum salary</em>. Answers within <code>10<sup>-5</sup></code> of the actual answer will be accepted.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> salary = [4000,3000,1000,2000]
10+
<strong>Output:</strong> 2500.00000
11+
<strong>Explanation:</strong> Minimum salary and maximum salary are 1000 and 4000 respectively.
12+
Average salary excluding minimum and maximum salary is (2000+3000) / 2 = 2500
13+
</pre>
14+
15+
<p><strong class="example">Example 2:</strong></p>
16+
17+
<pre>
18+
<strong>Input:</strong> salary = [1000,2000,3000]
19+
<strong>Output:</strong> 2000.00000
20+
<strong>Explanation:</strong> Minimum salary and maximum salary are 1000 and 3000 respectively.
21+
Average salary excluding minimum and maximum salary is (2000) / 1 = 2000
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li><code>3 &lt;= salary.length &lt;= 100</code></li>
29+
<li><code>1000 &lt;= salary[i] &lt;= 10<sup>6</sup></code></li>
30+
<li>All the integers of <code>salary</code> are <strong>unique</strong>.</li>
31+
</ul>

0 commit comments

Comments
 (0)