Let #(x y z) be a collection of votes for every candidate.
Then, You should compute:
(Array with: #(3 x) with: #(2 y) with: #(1 z)) inject: 0 into: [ :result :item | (item at: 1) * (item at: 2) + result]