Tap here to switch tabs
Problem
Submissions

Problem: Count Odd Letters from Number

med
30 min
Try to solve the Count Odd Letters from Number problem.

Statement

Given a positive integer n, convert each digit of n into its English word representation and concatenate them together in order from left to right.

The digit mappings are as follows:

  • 0→0 \rightarrow "zero"

  • 1→1 \rightarrow "one"

  • 2→2 \rightarrow "two"

  • 3→3 \rightarrow "three"

  • 4→4 \rightarrow "four"

  • 5→5 \rightarrow "five"

  • 6→6 \rightarrow "six"

  • 7→7 \rightarrow "seven"

  • 8→8 \rightarrow "eight"

  • 9→9 \rightarrow "nine"

Return the number of unique characters that have an odd frequency in the concatenated string.

Constraints:

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Odd Letters from Number

med
30 min
Try to solve the Count Odd Letters from Number problem.

Statement

Given a positive integer n, convert each digit of n into its English word representation and concatenate them together in order from left to right.

The digit mappings are as follows:

  • 0→0 \rightarrow "zero"

  • 1→1 \rightarrow "one"

  • 2→2 \rightarrow "two"

  • 3→3 \rightarrow "three"

  • 4→4 \rightarrow "four"

  • 5→5 \rightarrow "five"

  • 6→6 \rightarrow "six"

  • 7→7 \rightarrow "seven"

  • 8→8 \rightarrow "eight"

  • 9→9 \rightarrow "nine"

Return the number of unique characters that have an odd frequency in the concatenated string.

Constraints:

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