← ALL NOTES
Array

1262. Greatest Sum Divisible by Three

Return the maximum subset sum divisible by 3. The clean idea: take the total, and if it's not already divisible by 3, remove the minimum amount needed to fix the remainder. That removal only ever…

Loading…