Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python or java. make sure it runs Asteroid Mining Programming challenge description: You are starting an asteroid mining mission with a single harvester robot.

in python or java. make sure it runs
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Asteroid Mining Programming challenge description: You are starting an asteroid mining mission with a single harvester robot. That robot is capable of mining one gram of mineral per day. It also has the ability to clone itself by constructing another harvester robot. That new robot becomes available for use the next day and can be involved in the mining process or can be used to construct yet another robot. Each day you will decide what you want each robot in your fleet to do. They can either mine one gram of mineral or spend the day constructing another robot. Write a program to compute a minimum number of days required to mine n grams of mineral Note that you can mine more mineral than required. Just ensure that you spent the required. Just ensure that you spent the minimum possible number of days to have the necessary amount of mineral mined. Input: A single integer number n, which is the number of grams of mineral to be mined. The value of n will be between 1 and 1000000 (inclusive). For example: 9 Output: A single integer, the minimum number of days required to mine n grams of mineral. For example: Test 1 Test Input Test 1 Test Input 1 Expected Output 1 Test 2 Test Input 4 Expected Output 3 Test 3 A Test 3 Test Input @ 99 Expected Output 8 Test 4 Test Input 1000000 Expected Output 21

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions