1484. Group Sold Products By The Date LeetCode Solution
In this guide, you will get 1484. Group Sold Products By The Date LeetCode Solution with the best time and space complexity. The solution to Group Sold Products By The Date problem is provided in various programming languages like C++, Java, and Python. This will be helpful for you if you are preparing for placements, hackathons, interviews, or practice purposes. The solutions provided here are very easy to follow and include detailed explanations.
Table of Contents
- Problem Statement
- Complexity Analysis
- Group Sold Products By The Date solution in C++
- Group Sold Products By The Date solution in Java
- Group Sold Products By The Date solution in Python
- Additional Resources

Problem Statement of Group Sold Products By The Date
Table Activities:
+————-+———+
| Column Name | Type |
+————-+———+
| sell_date | date |
| product | varchar |
+————-+———+
There is no primary key (column with unique values) for this table. It may contain duplicates.
Each row of this table contains the product name and the date it was sold in a market.
Write a solution to find for each date the number of different products sold and their names.
The sold products names for each date should be sorted lexicographically.
Return the result table ordered by sell_date.
The result format is in the following example.
Example not found
Constraints not found
Complexity Analysis
- Time Complexity: Google AdSense
- Space Complexity: Google Analytics
1484. Group Sold Products By The Date LeetCode Solution in C++
SELECT
sell_date,
COUNT(DISTINCT product) AS num_sold,
GROUP_CONCAT(DISTINCT product ORDER BY product) AS products
FROM Activities
GROUP BY 1;
/* code provided by PROGIEZ */
1484. Group Sold Products By The Date LeetCode Solution in Java
N/A
// code provided by PROGIEZ
1484. Group Sold Products By The Date LeetCode Solution in Python
N/A
# code by PROGIEZ
Additional Resources
- Explore all LeetCode problem solutions at Progiez here
- Explore all problems on LeetCode website here
Happy Coding! Keep following PROGIEZ for more updates and solutions.