Problem 1262 · Medium

Greatest Sum Divisible by Three

Find the largest sum of a subset of the array whose total is divisible by three. The visual tracks the best sum for each remainder class as each value is considered.

Open the interactive visualisation