Skip to content

Commit

Permalink
Create README - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
hovanhoa committed Oct 23, 2023
1 parent f04065b commit c81809a
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions 0177-nth-highest-salary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<h2><a href="https://leetcode.com/problems/nth-highest-salary/">177. Nth Highest Salary</a></h2><h3>Medium</h3><hr><p>Table: <code>Employee</code></p>

<pre>
+-------------+------+
| Column Name | Type |
+-------------+------+
| id | int |
| salary | int |
+-------------+------+
id is the primary key (column with unique values) for this table.
Each row of this table contains information about the salary of an employee.
</pre>

<p>&nbsp;</p>

<p>Write a solution to find the <code>n<sup>th</sup></code> highest salary from the <code>Employee</code> table. If there is no <code>n<sup>th</sup></code> highest salary, return&nbsp;<code>null</code>.</p>

<p>The result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong>
Employee table:
+----+--------+
| id | salary |
+----+--------+
| 1 | 100 |
| 2 | 200 |
| 3 | 300 |
+----+--------+
n = 2
<strong>Output:</strong>
+------------------------+
| getNthHighestSalary(2) |
+------------------------+
| 200 |
+------------------------+
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong>
Employee table:
+----+--------+
| id | salary |
+----+--------+
| 1 | 100 |
+----+--------+
n = 2
<strong>Output:</strong>
+------------------------+
| getNthHighestSalary(2) |
+------------------------+
| null |
+------------------------+
</pre>

0 comments on commit c81809a

Please sign in to comment.