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

 

numFives


Mr. Monroe will give his AP CS students an array of ints. He want to know how many possible pairs of numbers will equal the number 5. Write a method to serve this purpose.


numFives([0, 1, 2, 3, 4, 5]) → 3
numFives([-5, -4, -3, -2, -1, 0]) → 0
numFives([-29, 98, 6, 32, -1]) → 1

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

public int numFives(int[] arr) { }

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