Search⌘ K
AI Features

Put Marbles in Bags

Put Marbles in Bags divides a weights array into k nonempty contiguous groups. Each bag costs the weights of its endpoint marbles; return the difference between the highest and lowest possible total scores.

Statement

You are given k bags and a 0-indexed integer array, weights, where weights[i] represents the weight of the ...