← Barclays questions

Maximize alternating partition sum

Filed under Barclays

Given an array of N integers, divide the array into K contiguous partitions such that the alternating sum P1 - P2 + P3 - P4 + ... + (-1)^(K-1)*Pk is maximized, where Pi is the sum of the elements in…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Barclays questions

Collected from public candidate posts and coding forums. Updated Nov 2026.