about | help | code help+videos | done | prefs |
Given a positive integer, a digit in the number is "lonely" if it appears in the number only 1 time. For example, in the number 343, the 4 is lonely. In the number 18608, the 1, 6, and 0 are lonely. Write a method that returns a count of the lonely digits. lonelyCount(343) → 1 lonelyCount(18608) → 3 lonelyCount(2) → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy