I hereby claim:
- I am brendaneamon on github.
- I am brendan_eamon (https://keybase.io/brendan_eamon) on keybase.
- I have a public key ASAhnd2r4rESFuO0fXCw6iPqCage7E9XA4FFofI_HVYF_go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
'use strict' | |
function getFibonacciNumber (pos, cache = [1, 1]) { | |
if (cache[pos - 1]) { | |
return cache[pos - 1] | |
} | |
const next = cache[cache.length - 2] + cache[cache.length - 1] | |
return getFibonacciNumber(pos, [...cache, next]) |
'use strict' | |
function getAddendPairs(numArray, sum) { | |
let difference | |
return numArray.reduce((acc, num) => { | |
difference = sum - num | |
if (!acc.map.has(num)) { | |
acc.map.set(num, true) | |
} |
'use strict' | |
function getMean (numbers) { | |
return numbers.reduce((acc, num) => { | |
return acc += num | |
}, 0) / numbers.length | |
} | |
function getMedian (numbers) { | |
const sorted = [...numbers].sort((a, b) => a - b) |