Company: Virtusa..._11oct
Difficulty: medium
Frog in the Pond Problem Description Near your house there is a pond that has N lily pads arranged in sequence. An integer array A contains the count of fallen fresh petals on each lily pad. A happy frog wants to gather as many petals as possible by jumping from one lily pad to the next adjacent lily pad in either direction. The frog can begin gathering petals from any lily pad, but can only jump a maximum of N-2 times. Your task is to find and return an integer value representing the maximum number of petals that the frog can collect in a maximum of N-2 jumps. Input: input1 : An integer value N, representing the number of lily pads. input2 : An integer array A, containing the count of fallen petals on N lily pads. Output: Return an integer value representing the maximum number of petals that the frog can collect in a maximum of N-2 jumps. Constraints Assume 1-based indexing. If the frog lands on a lily pad, it will collect all the petals on the pad. The frog can begin collecting petal