Company: Phonepe_4july
Difficulty: medium
Maximum Triplet Problem Description Sagar is playing with an array and now he also feels bored. But, suddenly, he comes up with a problem to solve. He wants to calculate the maximum sum that three consecutive elements can have in the array. Complete the function maximumTriplet to return an integer to the problem. /* * Complete the 'maximumTriplet' function below. * * The function is expected to return an LONG INTEGER. * The function accepts LONG_INTEGER_ARRAY array as parameter. */ long maximumTriplet(vector<long> array) { // Write your code here } Input Format The first line of input contains an integer N Next N lines of input contain an integer each, the elements of the array. Constraints 3 <= N <= 10^6 1 <= A[i] <= 10^9 Output Format Return a single integer, the answer to the problem. Examples Example 1: Input: 6 5 2 4 1 6 5 Output: 12 Explanation: You can take the elements (1, 6, 5) to make the sum 12. Example 2: Input: 5 19 3 27 36 6 Output: 69 Explanation: You c