Article Views II — LeetCode 1149 Python Solution
MediumLeetCode PremiumDatabase
- Problem
- #1149
- Reading time
- 2 min
- Source
- leetcode.com
Table schema
SQL
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
SQL
+---------------+---------+
| 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
| Measure | Complexity |
|---|---|
| Time | O(n log n) (typical) |
| Space | O(n) auxiliary |
Related problems
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.