Categories
coding solutions

Codility MaxDoubleSliceSum Solution

MaxDoubleSliceSum Solution Task The task is a variation of the Maximum subarray problem found in the max slice sum task: A non-empty array A consisting of N integers is given. A triplet (X, Y, Z), such that 0 ≤ X < Y < Z < N, is called a double slice. The sum of double […]

Categories
coding solutions

Codility: MaxSliceSum Solution

MaxSliceSum solution Task The task is to maximise the sum of a subsequence of an array. A non-empty array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P ≤ Q < N, is called a slice of array A. The sum of a slice (P, Q) […]