Also reported as Merge Products into Categories
Amazon coding question, reconstructed from 7 candidate reports (November 2025 to September 2026). Tests: union-find; DFS and connected components. Candidates reported 2 follow-ups. The write-up includes a Python solution that passes 12 test cases.