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

 

frew@mclean.com > combIsOdd
prev  |  next  |  chance

Which binomial coefficients are odd? Determine if nCr is odd for a given n and r. This program returns true when an entire row is odd - rows with mixed true/false will only test false examples (also won't test 1). Factorial won't work for numbers greater than 20, so you'll need to find another way.


combIsOdd(32, 30) → false
combIsOdd(256, 4) → false
combIsOdd(5, 3) → false

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

public boolean combIsOdd(int n, int k) { }

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

Copyright Nick Parlante 2017 - privacy