Company: Flipkart_3aug
Difficulty: medium
Max Gold Coins Collection Problem Description An adventurer is exploring a row of ancient vaults, each holding a pile of gold coins. She may raid any vault she likes, but the moment she takes coins from one, an ancient curse stops her from ever touching the vaults directly beside it. In other words, if she raids vault 'i', vaults 'i-1' and 'i+1' become off-limits. Given N vaults, each holding some number of gold coins C, write a program to find the maximum total M of gold coins she can collect. Input Format: The first line of input contains N, the number of vaults. The second input line contains N numbers separated by a single white space, representing the number of gold coins in each vault. Output Format: The output contains M, the maximum number of gold coins that can be collected. Constraints I) 0 < N < 10 4 II) 0 <= C < 10 9 III) The number of gold coins in each vault C satisfies 0 <= C < 10 9 . Examples Example 1: Input: 5 1 2 3 4 5 Output: 9 Explanation: N=5, wi