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
      2 of 102

      The billionaire

      A billionaire walks into a bar. Write typical_person(salaries): a salary that describes a typical person in the room. It starts as the fair share from the last puzzle.

      Five people are in a bar, and one of them is a billionaire. Your function gets everyone’s salary and hands back the salary of a typical person in the room.

      salaries (thousands a year)Ana40Ben45Cai50Dee52billionaire1,000,000typical_person(…)0 of 5 ina typical person’s salary

      which salary should come out? that’s for you to decide

      Your functiontypical_person(salaries)
      salariesone number per person in the room, in thousandse.g. [40, 45, 50, 52, 1000000]
      returnsthe salary of a typical person
      solution.pyLoading Python
      Sign in for an AI hint
      ← Fair shareGrade calculator →