You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><ahref="https://leetcode.com/problems/number-of-unique-subjects-taught-by-each-teacher">Number of Unique Subjects Taught by Each Teacher</a></h2> <imgsrc='https://img.shields.io/badge/Difficulty-Easy-brightgreen'alt='Difficulty: Easy' /><hr><p>Table: <code>Teacher</code></p>
2
+
3
+
<pre>
4
+
+-------------+------+
5
+
| Column Name | Type |
6
+
+-------------+------+
7
+
| teacher_id | int |
8
+
| subject_id | int |
9
+
| dept_id | int |
10
+
+-------------+------+
11
+
(subject_id, dept_id) is the primary key (combinations of columns with unique values) of this table.
12
+
Each row in this table indicates that the teacher with teacher_id teaches the subject subject_id in the department dept_id.
13
+
</pre>
14
+
15
+
<p> </p>
16
+
17
+
<p>Write a solution to calculate the number of unique subjects each teacher teaches in the university.</p>
18
+
19
+
<p>Return the result table in <strong>any order</strong>.</p>
20
+
21
+
<p>The result format is shown in the following example.</p>
0 commit comments