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

      The shadow

      Two arrows on a flat floor, each a list [across, up]. The direction marks a line through the start; light falls on it at a right angle, so every point of arrow drops straight onto that line. Write shadow(arrow, direction): how far the arrow’s shadow reaches along the direction. A shadow that falls backward, against the direction, counts as negative.

      arrow: 3 across, 4 up
      acrossup
      34
      direction: along the floor’s edge
      acrossup
      10
      solution.pyLoading Python
      ← Invent the scoreDo they move together? →