There is a special apple tree that produces apples for n consecutive days. On day i (starting from day apples[i] apples that will spoil after days[i] days. Specifically, any apple grown on day i rots on day days[i] and can no longer be consumed on or after that day. On some days, the tree might not yield any apples, represented by apples[i] days[i]
You can eat at most n days have elapsed.
Return the maximum number of apples you can eat.
Constraints:
n $= $ apples.length $= $ days.length
n
apples[i], days[i]
days[i] apples[i]
There is a special apple tree that produces apples for n consecutive days. On day i (starting from day apples[i] apples that will spoil after days[i] days. Specifically, any apple grown on day i rots on day days[i] and can no longer be consumed on or after that day. On some days, the tree might not yield any apples, represented by apples[i] days[i]
You can eat at most n days have elapsed.
Return the maximum number of apples you can eat.
Constraints:
n $= $ apples.length $= $ days.length
n
apples[i], days[i]
days[i] apples[i]