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
      75 of 88

      The greedy trap

      A language model writes two-word sentences. first_chances[i] is the chance it starts with first word i, and second_chances[i][j] is the chance that next word j follows it. Write best_sentence(first_chances, second_chances): return [i, j], the most likely sentence of all.

      first_chances
      thea
      0.60.4
      second_chances
      catdogsunend
      the0.30.250.250.2
      a0.050.90.030.02
      solution.pyLoading Python
      ← Softmax on the goFind your twin →