Skip to content

Commit 3c76895

Browse files
committed
Added README.md file for Classes More Than 5 Students
1 parent e5d8efc commit 3c76895

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<h2><a href="https://leetcode.com/problems/classes-more-than-5-students">Classes More Than 5 Students</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Table: <code>Courses</code></p>
2+
3+
<pre>
4+
+-------------+---------+
5+
| Column Name | Type |
6+
+-------------+---------+
7+
| student | varchar |
8+
| class | varchar |
9+
+-------------+---------+
10+
(student, class) is the primary key (combination of columns with unique values) for this table.
11+
Each row of this table indicates the name of a student and the class in which they are enrolled.
12+
</pre>
13+
14+
<p>&nbsp;</p>
15+
16+
<p>Write a solution to find all the classes that have <strong>at least five students</strong>.</p>
17+
18+
<p>Return the result table in <strong>any order</strong>.</p>
19+
20+
<p>The&nbsp;result format is in the following example.</p>
21+
22+
<p>&nbsp;</p>
23+
<p><strong class="example">Example 1:</strong></p>
24+
25+
<pre>
26+
<strong>Input:</strong>
27+
Courses table:
28+
+---------+----------+
29+
| student | class |
30+
+---------+----------+
31+
| A | Math |
32+
| B | English |
33+
| C | Math |
34+
| D | Biology |
35+
| E | Math |
36+
| F | Computer |
37+
| G | Math |
38+
| H | Math |
39+
| I | Math |
40+
+---------+----------+
41+
<strong>Output:</strong>
42+
+---------+
43+
| class |
44+
+---------+
45+
| Math |
46+
+---------+
47+
<strong>Explanation:</strong>
48+
- Math has 6 students, so we include it.
49+
- English has 1 student, so we do not include it.
50+
- Biology has 1 student, so we do not include it.
51+
- Computer has 1 student, so we do not include it.
52+
</pre>

0 commit comments

Comments
 (0)