MCPcopy Create free account
hub / github.com/danialgoodwin/dev / NumberOfRolls

Method NumberOfRolls

code-practice/code-fights/NumberOfRolls.java:37–41  ·  view source on GitHub ↗

You have a fair N-sided die, but you want a fair K-sided die, so you try simulating a fair K-sided die by rolling the N-sided die some number of times. Given N and K, return the minimum number of times you have to roll the N-sided die to get a K-sided die. Return -1 if you can't simulate it no matt

(int n, int k)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 5

gMethod · 0.80
maxMethod · 0.80
gcdMethod · 0.80
powerMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected