Tap here to switch tabs
Problem
Submissions

Problem: Digit Frequency Score

Try to solve the Digit Frequency Score problem.

Statement

Given a positive integer n, compute its digit frequency score.

The digit frequency score is calculated by finding the frequency of each unique digit present in n, multiplying each digit by its frequency, and summing these values together.

Return the total digit frequency score of n.

Constraints:

  • 1≤1 \leq n ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Digit Frequency Score

Try to solve the Digit Frequency Score problem.

Statement

Given a positive integer n, compute its digit frequency score.

The digit frequency score is calculated by finding the frequency of each unique digit present in n, multiplying each digit by its frequency, and summing these values together.

Return the total digit frequency score of n.

Constraints:

  • 1≤1 \leq n ≤109\leq 10^9