Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
"Call to home" solution in Clear category for [old] Call to Home by capback250
"use strict";
function totalCost(calls) {
const tracker = new Map();
calls.map(call => {
let [date, _, duration] = call.split(' ');
let acc = tracker.get(date);
tracker.set(date, acc ? acc + Math.ceil(duration / 60) : Math.ceil(duration / 60));
});
return [...tracker.values()]
.map(dur => dur <= 100 ? dur : 100 + (dur - 100) * 2)
.reduce((a, b) => a + b, 0)
}
May 18, 2017