leetle

Daily challenge for 2026-08-25

602. Shared Interest Grouping

You are given an array of user profiles, where each profile is an array of interest tags (strings). Return the maximum number of users who all share at least one common interest tag. The same tag must appear in every profile in the group. Each user counts once per tag, even if their profile contains that tag more than once. If there are no interest tags, return 0.

Example:
Input: profiles = [["sports","music"],["music","art"],["cooking"],["sports","art"]]
Output: 2
Explanation: "sports" appears in profiles 0 and 3, "music" in profiles 0 and 1, and "art" in profiles 1 and 3. No tag appears in more than two profiles, so the answer is 2. Profiles 0, 1, and 3 do not form a valid group because there is no single tag common to all three.

Run this challenge interactively in Python or JavaScript when the app loads.