id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

norm.krumpe@muohio.edu lab8warmup > lonelyCount
prev  |  next  |  chance

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)

int lonelyCount(int n) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 200

Copyright Nick Parlante 2017 - privacy