Market Analysis II — LeetCode 1159 Python Solution
HardLeetCode PremiumDatabase
- Problem
- #1159
- Reading time
- 2 min
- Source
- leetcode.com
Table schema
SQL
Table: Users +----------------+---------+ | Column Name | Type | +----------------+---------+ | user_id | int | | join_date | date | | favorite_brand | varchar | +----------------+---------+ user_id is the primary key (column with unique values) of this table. This table has the info of the users of an online shopping website where users can sell and buy items.Example
SQL
+----------------+---------+
| Column Name | Type |
+----------------+---------+
| user_id | int |
| join_date | date |
| favorite_brand | varchar |
+----------------+---------+
user_id is the primary key (column with unique values) of this table.
This table has the info of the users of an online shopping website where users can sell and buy items.Complexity
| Measure | Complexity |
|---|---|
| Time | O(n log n) (typical) |
| Space | O(n) auxiliary |
Related problems
Frequently asked questions
- How hard is LeetCode 1159. Market Analysis II?
- LeetCode 1159. Market Analysis II is rated Hard on LeetCode.
- What topics does LeetCode 1159. Market Analysis II cover?
- LeetCode 1159. Market Analysis II is tagged Database on LeetCode.
- Is LeetCode 1159. Market Analysis II a premium problem?
- Yes. LeetCode 1159. Market Analysis II is a LeetCode Premium problem, so the full statement and test cases require a paid LeetCode subscription.