Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      20 of 102

      Shared interests

      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.

      Ana is looking for friends, and is into chess, jazz, hiking.AnachessjazzhikingBenchessjazzMaxchesshikingjazzcookingfootballpaintingpokerrunningsci-fibakingcyclingphotographygardeninganimeclimbingyogasurfingknittingtennisgamingshared with Ana: Ben 2 · Max 3 (wins)overlap, 0 to 1: Ana & Ben ? · Ana & Max ?
      Your functionoverlap(likes_a, likes_b)
      likes_awhat each person is into, e.g. ["chess", "jazz"]e.g. ["chess", "go"]
      likes_bwhat each person is into, e.g. ["chess", "jazz"]e.g. ["chess", "go"]
      returnshow much their interests overlap: 0 = nothing, 1 = identical
      solution.pyLoading Python
      Sign in for an AI hint
      ← Which fruit is it?Colors into numbers →