Microsoft OA help
Anonymous User
685

You are given an array Eg [1,2,3,4,5,6] and You can merge 2 adjacent numbers only once. Find the max sum obtained among all the pairs Eg [1,2,3,4,5,6] will give pairs like [12, 34, 56] or [1,2,34,56] or [1,23,4,56] etc after merging but the maximum sum will be obtained by the pair [12, 34, 56] and Note: Order of number can't change .Write a C++ code for it

Comments (10)