Remove k consecutive machines to minimize strength differences

0
Remix

Machines stand in a row, each with a strength. Remove exactly k consecutive machines so that the sum of absolute differences between neighbouring strengths in the remaining row is as small as possible, and return that sum.

AmazonCodingLast asked Aug 2025
No answer yet. Write the first one; the best answer gets endorsed.