Skip to content

Commit b4d7b2b

Browse files
committed
Create README - LeetHub
1 parent 796a408 commit b4d7b2b

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

‎0577-employee-bonus/README.md‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<h2><a href="https://leetcode.com/problems/employee-bonus">577. Employee Bonus</a></h2><h3>Easy</h3><hr><p>Table: <code>Employee</code></p>
2+
3+
<pre>
4+
+-------------+---------+
5+
| Column Name | Type |
6+
+-------------+---------+
7+
| empId | int |
8+
| name | varchar |
9+
| supervisor | int |
10+
| salary | int |
11+
+-------------+---------+
12+
empId is the column with unique values for this table.
13+
Each row of this table indicates the name and the ID of an employee in addition to their salary and the id of their manager.
14+
</pre>
15+
16+
<p>&nbsp;</p>
17+
18+
<p>Table: <code>Bonus</code></p>
19+
20+
<pre>
21+
+-------------+------+
22+
| Column Name | Type |
23+
+-------------+------+
24+
| empId | int |
25+
| bonus | int |
26+
+-------------+------+
27+
empId is the column of unique values for this table.
28+
empId is a foreign key (reference column) to empId from the Employee table.
29+
Each row of this table contains the id of an employee and their respective bonus.
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
34+
<p>Write a solution to report the name and bonus amount of each employee who satisfies either of the following:</p>
35+
36+
<ul>
37+
<li>The employee has a bonus <strong>less than</strong> <code>1000</code>.</li>
38+
<li>The employee did not get any bonus.</li>
39+
</ul>
40+
41+
<p>Return the result table in <strong>any order</strong>.</p>
42+
43+
<p>The&nbsp;result format is in the following example.</p>
44+
45+
<p>&nbsp;</p>
46+
<p><strong class="example">Example 1:</strong></p>
47+
48+
<pre>
49+
<strong>Input:</strong>
50+
Employee table:
51+
+-------+--------+------------+--------+
52+
| empId | name | supervisor | salary |
53+
+-------+--------+------------+--------+
54+
| 3 | Brad | null | 4000 |
55+
| 1 | John | 3 | 1000 |
56+
| 2 | Dan | 3 | 2000 |
57+
| 4 | Thomas | 3 | 4000 |
58+
+-------+--------+------------+--------+
59+
Bonus table:
60+
+-------+-------+
61+
| empId | bonus |
62+
+-------+-------+
63+
| 2 | 500 |
64+
| 4 | 2000 |
65+
+-------+-------+
66+
<strong>Output:</strong>
67+
+------+-------+
68+
| name | bonus |
69+
+------+-------+
70+
| Brad | null |
71+
| John | null |
72+
| Dan | 500 |
73+
+------+-------+
74+
</pre>

0 commit comments

Comments
 (0)