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

 

jebbert@volusia.k12.fl.us > dec16_2019_P1SLHL_countDigits
prev  |  next  |  chance

Write a method that returns the number of times the 'targetDigit' appears as a digit in any of the numbers in the array 'nums'. Look at the test data for examples.


dec16_2019_P1SLHL_countDigits([453, 421, 547, 532, 9867, 685, 457, 988523, 532], 3) → 4
dec16_2019_P1SLHL_countDigits([6, 3, 7, 2, 1, 5, 9], 4) → 0
dec16_2019_P1SLHL_countDigits([6, 3, 7, 2, 1, 5, 9], 7) → 1

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

public int dec16_2019_P1SLHL_countDigits(int[] nums, int targetDigit) { }

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: 290

Copyright Nick Parlante 2017 - privacy