Difficulty: Easy
Acceptance: %
Points: 20.00
There are several trees arranged in a circle, each with a fruit value associated with it. A bird can gather all the fruits from a tree by sitting on it for 0.5 seconds and can move to a neighboring tree in another 0.5 seconds. Once all the fruits are picked from a tree, the bird cannot pick any more from that tree until all fruits are picked, it cannot move to next tree. The bird has totalTime seconds to gather as many fruits as possible and can start from any tree.
Given the array arr[] of fruit values and totalTime, determine the maximum number of fruits the bird can gather.
NA