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

      The best single direction

      A map of towns, each at [x, y]. You may keep one straight road, and every town moves onto it, to its shadow (as in “The shadow”). Write main_direction(points): which way the road should run to keep the towns as spread out as possible, as an arrow [dx, dy] of length 1. Where the road sits doesn’t matter, only its direction, and either sign is fine: [1, 0] and [-1, 0] are the same road.

      solution.pyLoading Python
      ← How much does it stretch?Two pizza shops →