SIMPLE AND DETAILED CODE WITHOUT MELT() FUNC
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimport pandas as pd\n\ndef rearrange_products_table(products: pd.DataFrame) -> pd.DataFrame:\n    result_data = []\n\n    # Iterate through each row in the DataFrame\n    for index, row in products.iterrows():\n        product_id = row[\'product_id\']\n        if row[\'store1\'] is not None:\n            result_data.append([product_id, \'store1\', row[\'store1\']])\n        if row[\'store2\'] is not None:\n            result_data.append([product_id, \'store2\', row[\'store2\']])\n        if row[\'store3\'] is not None:\n            result_data.append([product_id, \'store3\', row[\'store3\']])\n\n    # Create a DataFrame from the rearranged data\n    result_df = pd.DataFrame(result_data, columns=[\'product_id\', \'store\', \'price\'])\n\n    # Display the result\n    return result_df.sort_values(by=\'store\').dropna()\n\n```
['Pandas']