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

 

tmhscs@gmail.com monroe > numPairs
prev  |  next  |  chance

Mr. Monroe has a class of CSB kids and a class of CS Independent kids in the same period. He wants to select a pair of CSB students to demonstrate their code to the class. In addition, he wants to separately select a pair of CS Independent kids to demonstrate their code to the class as well alongside the CSB kids. However, he will select these pairs separately. How many possible combinations of 4 students can Monroe select to demonstrate their code?


numPairs(18, 3) → 459
numPairs(9000, 2) → 40495500
numPairs(300, 300) → 2011522500

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

public int numPairs(int csb, int csind) { }

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: 250 Post-solution available

Copyright Nick Parlante 2017 - privacy