Tap here to switch tabs
Problem
Submissions

Problem: Digit Frequency Score

Digit Frequency Score asks you to examine a positive integer, count how often each distinct digit appears, multiply each digit by its frequency, and return the sum.

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

Digit Frequency Score asks you to examine a positive integer, count how often each distinct digit appears, multiply each digit by its frequency, and return the sum.

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