Skip to content

Instantly share code, notes, and snippets.

View szabi84's full-sized avatar

szabi84 szabi84

  • Botium Wien
  • Győrújbarát
View GitHub Profile
'use strict';
const buckets = (buckets) => {
let sum = 0;
let times = 0;
for (let i = Math.min(...buckets); i < Math.max(...buckets); i++) {
let start = false;
let subTotal = 0;
for (const bucket of buckets) {
const atm = (value, banknotes, count = 0, bestCount = -1) => {
const filteredBankNotes = banknotes.filter(note => note <= value);
for (let i = 0; i < filteredBankNotes.length; i++) {
if (filteredBankNotes[i] <= value) {
count++;
value -= filteredBankNotes[i];
if (bestCount !== -1 && count > bestCount) {
break;
}
@szabi84
szabi84 / ultimate-ut-cheat-sheet.md
Created July 22, 2019 08:25 — forked from peter-asztalos/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies