Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

Assuming you are designing a recommendation system for an online marketplace. The system processes shopping records, where each record lists the stores a customer visited during a single shopping session.

Determine the co-occurrence patterns between stores. For each store, return a list of associated stores that are frequently visited together with it, based on the shopping records.

The results should be:

  1. An organized nested list, where each element corresponds to a target store.
  2. Sorted by the target store names in lexicographical order.
Test Cases
Input
Output
Expected