1553. Minimum Number of Days to Eat N Oranges
https://leetcode.com/problems/minimum-number-of-days-to-eat-n-oranges
Description
There are n
oranges in the kitchen and you decided to eat some of these oranges every day as follows:
Eat one orange.
If the number of remaining oranges (
n
) is divisible by 2 then you can eat n/2 oranges.If the number of remaining oranges (
n
) is divisible by 3 then you can eat 2*(n/3) oranges.
You can only choose one of the actions per day.
Return the minimum number of days to eat n
oranges.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= n <= 2*10^9
ac
Last updated