Find Odd Characters Of Number
You are given an integer n perform the following steps:
- Convert each digit of n into its lowercase English word (e.g., 4 → "four", 1 → "one").
- Concatenate those words in the original digit order to form a string s.
Return the number of characters in s that appear an odd number of times.
Example 1:
Input:Â n = 41
Output:Â 5
Explanation:
41 → "fourone"
Characters with odd frequencies: 'f', 'u', 'r', 'n', 'e'. Thus, the answer is 5.
Example 2:
Input:Â n = 20
Output:Â 5
Explanation:
20 → "twozero"
Characters with odd frequencies: 't', 'w', 'z', 'e', 'r'. Thus, the answer is 5.
Now Your Turn!
Pick the correct output for the given inputInput: n = 11
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= n <= 109