Skip to content

Instantly share code, notes, and snippets.

@w3dg
Forked from w3cj/robot-and-batteries.md
Created April 3, 2022 16:41
Show Gist options
  • Select an option

  • Save w3dg/0f8990c51dc2f4b6fcc0ca4dea1bb3c2 to your computer and use it in GitHub Desktop.

Select an option

Save w3dg/0f8990c51dc2f4b6fcc0ca4dea1bb3c2 to your computer and use it in GitHub Desktop.
Brain Teaser Warm-Up

Problem

A robotic technology startup is located in San Francisco. The CEO has 3000 battery packs that he wants to transport with Danny (the robotic bird) to his other branch, across a 1000-kilometer stretch of land. The owner has only one robotic bird, which carries a maximum of 1000 battery packs at any moment in time, and consumes one battery pack every kilometer it travels.

Question

What is the largest number of battery packs that can be delivered to the branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment