Posted: December 15th, 2023
given an array find max possible cp score where cp is contiguous partition, for example if an Array [3,-3,-3,5,6,-7], going through, one possible partition is [3,-3,-3],[5],[6,-7]
and this would equal (3 (-3) (-3)) * (5) * (6 (-7)) = 15
but we want the max possible score which ends up being this partition: [3], [-3,-3], [5], [6], [-7] which returns: 3 * ((-3) (-3)) * 5 * 6 * (-7) which has a cp score of 3780 which is the max possible score.
The code worst case scenario should be O(n3)
The code can be written in python, java, c code, or c
Place an order in 3 easy steps. Takes less than 5 mins.