http://www.codewars.com/kata/52b7ed099cdc285c300001cd/train/javascript
겹치는(overlap) 인터벌은 합치고 모든 인터벌의 길이의 합을 출력
sumIntervals( [
[1,2],
[6, 10],
[11, 15]
] ); //=> returns 9
http://www.codewars.com/kata/52b7ed099cdc285c300001cd/train/javascript
겹치는(overlap) 인터벌은 합치고 모든 인터벌의 길이의 합을 출력
sumIntervals( [
[1,2],
[6, 10],
[11, 15]
] ); //=> returns 9
문자열
1 3 +
을 계산
function calc(expr) {
if (!expr) return 0;
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Pete, the baker (part 2)
재료를 모두 사용할 수 있는 갯수에 대한 부족분을 계산(? 말로 적으니까 이상한데?)
var recipe = {flour: 200, eggs: 1, sugar: 100};
getMissingIngredients(recipe, {flour: 50, eggs: 1}); // must return {flour: 150, sugar: 100}
getMissingIngredients(recipe, {}); // must return {flour: 200, eggs: 1, sugar: 100}
getMissingIngredients(recipe, {flour: 500, sugar: 200}); // must return {flour: 100, eggs: 3, sugar: 100}