The Bird Problem: Facebook interview question | Darshit V Vora' s Blog
Question: There are n trees in a circle. Each tree has a fruit value associated with it. A bird can sit on a tree for 0.5 sec and then he has to move to a neighbouring tree. It takes the bird 0.5 seconds to move from one tree to another. The bird gets the fruit value when she sits on a tree. We are given n and m (the number of seconds the bird has), and the fruit values of the trees. We have to maximise the total fruit value that the bird can gather. The bird can start from any tree.
Read full article from The Bird Problem: Facebook interview question | Darshit V Vora' s Blog
No comments:
Post a Comment