Each person lists what they’re into, as tags like "chess" or "jazz". Write overlap(likes_a, likes_b): how much two people’s interests overlap, from 0 (nothing in common) to 1 (identical).
Ana is looking for friends on an app. Ben shares two of Ana’s interests; Max shares all three, but Max likes twenty things. Count what they share and see who wins, then click Max’s interests to drop some.
overlap(likes_a, likes_b)| likes_a | what each person is into, e.g. ["chess", "jazz"] | e.g. ["chess", "go"] |
| likes_b | what each person is into, e.g. ["chess", "jazz"] | e.g. ["chess", "go"] |
| returns | how much their interests overlap: 0 = nothing, 1 = identical | |