3712. Sum of Elements With Frequency Divisible by K
You are given an integer array
numsand an integerk.Return an integer denoting the sum of all elements in
numswhose frequency is divisible byk, or 0 if there are no such elements.Note: An element is included in the sum exactly as many times as it appears in the array if its total frequency is divisible by
k.
1 | class Solution { |