MediumNo. 1149LeetCode Premium
Article Views II — LeetCode 1149 Python Solution
- Topics
- Database
- Reading time
- 2 min
- Source
- leetcode.com
Table schema
Table: Views +---------------+---------+ | Column Name | Type | +---------------+---------+ | article_id | int | | author_id | int | | viewer_id | int | | view_date | date | +---------------+---------+ This table may have duplicate rows. Each row of this table indicates that some viewer viewed an article (written by some author) on some date.Example
+---------------+---------+
| Column Name | Type |
+---------------+---------+
| article_id | int |
| author_id | int |
| viewer_id | int |
| view_date | date |
+---------------+---------+
This table may have duplicate rows.
Each row of this table indicates that some viewer viewed an article (written by some author) on some date.
Note that equal author_id and viewer_id indicate the same person.Complexity
- Time
- O(n log n)(typical)
- Space · auxiliary
- O(n)
Related problems
| No. | Problem | Difficulty |
|---|---|---|
| 0175 | Combine Two Tables | Easy |
| 0176 | Second Highest Salary | Medium |
| 0177 | Nth Highest Salary | Medium |
| 0178 | Rank Scores | Medium |
| 0180 | Consecutive Numbers | Medium |
| 0181 | Employees Earning More Than Their Managers | Easy |
Frequently asked questions
- How hard is LeetCode 1149. Article Views II?
LeetCode 1149. Article Views II is rated Medium on LeetCode.
- What topics does LeetCode 1149. Article Views II cover?
LeetCode 1149. Article Views II is tagged Database on LeetCode.
- Is LeetCode 1149. Article Views II a premium problem?
Yes. LeetCode 1149. Article Views II is a LeetCode Premium problem, so the full statement and test cases require a paid LeetCode subscription.