Tap here to switch tabs
Problem
Submissions

Problem: Sum of Elements With Frequency Divisible by K

Try to solve the Sum of Elements With Frequency Divisible by K problem.

Statement

Given an integer array nums and an integer k, return the sum of all elements in nums whose frequency in nums is divisible by k.

If no elements satisfy this condition, return 00.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

  • 1≤1 \leq k ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Elements With Frequency Divisible by K

Try to solve the Sum of Elements With Frequency Divisible by K problem.

Statement

Given an integer array nums and an integer k, return the sum of all elements in nums whose frequency in nums is divisible by k.

If no elements satisfy this condition, return 00.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

  • 1≤1 \leq k ≤100\leq 100