Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
new programers think that oneliners solutions are good so they upvote them
shtup clyde
I see this answer has a few ups for best practices, can anyone explain why this would be a best practice solution? I can definitely see clever, but typically part of best practice is readability!
This comment is hidden because it contains spoiler information about the solution
Fortunatelly we are wikipedia gifted :-) Read the first paragraph and "Change of base":
https://en.wikipedia.org/wiki/Logarithm
At the end logarithm to the base of 100% - evap_per_day (in %) of thershold (in %) gives you the number of days.
Your changes are not needed. We read the conditions: "The input will always be valid (numbers will be an array of length 2 or greater, and all of the items will be numbers; target will always be the sum of two different items from that array)."
Therefore, the code is never executed: return {0, 0};
and solution will be found before the condition is met i == number.size() - 1.