#3190

Find Minimum Operations to Make All Elements Divisible by Three

newbie · 100 · lc easy +12 · 90.9% accepted · 511 likes · top 100%

Description

Given an integer array nums, a single operation lets you increment or decrement any element by 1.

Return the minimum number of operations needed to make every element of nums divisible by 3.

Code

1
2
3