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

 

LOOPs_countDigit


Given a non-negative integer n and a digit d (0–9), return how many times d appears in n. If the digit d is out of range, return a -1.


LOOPs_countDigit(707070, 7) → 3
LOOPs_countDigit(1000, 0) → 3
LOOPs_countDigit(0, 0) → 1

...Save, Compile, Run (ctrl-enter)

public int LOOPs_countDigit(int n, int d) { }

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

Copyright Nick Parlante 2017 - privacy