We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Its a simple problem. On each reaching height h bots energy is 2*botEnergy - h; irrespective of the gain or loss; so you can solve it from backwards initial energy to be zero; e=(e+h)/2 or (e+h)/2+1 depending on the value of e+h , here even and odd respectively.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Chief Hopper
You are viewing a single comment's thread. Return to all comments →
Its a simple problem. On each reaching height h bots energy is 2*botEnergy - h; irrespective of the gain or loss; so you can solve it from backwards initial energy to be zero; e=(e+h)/2 or (e+h)/2+1 depending on the value of e+h , here even and odd respectively.