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

 

sspiege3@schools.nyc.gov arrayreview > countValues
prev  |  next  |  chance

Given an array of integers, nums, and an integer, n, return a count of all of the values in the array that equal n.


countValues([1, 2, 3, 2, 3, 5], 2) → 2
countValues([1, 2, 3], 4) → 0
countValues([1, 1, 1], 1) → 3

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

public int countValues(int[] nums, 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: 175 Post-solution available

Copyright Nick Parlante 2017 - privacy