Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Count how often pairs of stores appear together in the same shopping session.
Group companion stores by each target store and sort them by co-occurrence frequency descending, then lexicographically.
Return the final results as a nested list sorted alphabetically by target store.
What This Tests
Hash map based frequency counting
Nested dictionary manipulation
Multi-criteria custom sorting
Set operations for unique element tracking
Common Patterns
Hashing
Sorting
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected