Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Call to Home by Moff
function totalCost(calls){
let call_duration = {};
for (let call of calls) {
let a = call.split(' ');
let v = Math.ceil(parseInt(a[2]) / 60);
call_duration[a[0]] = call_duration[a[0]] + v || v
}
let result = 0;
for (let date in call_duration) {
let m = call_duration[date];
result += m <= 100 ? m : m * 2 - 100;
}
return result;
}
July 12, 2017