LeetCode 1795: Rearrange Products Table

Database

Problem Description

Explanation:

To rearrange the Products table, we need to transform each row into multiple rows where each row contains the product_id, store, and price. We iterate over each row in the original table and for each store that has a price, we add a new row with the corresponding product_id, store, and price to the result. Solution:

Solutions

# Write your Java solution here

Loading editor...