DEV Community

loading...

Discussion on: Coding Puzzles: Week of 4/8

Collapse
laurieontech profile image
Laurie • Edited

Javascript (ES6):

function stairs_in_20(stairs) {
       return stairs.reduce((steps, day) => steps.concat(day)).reduce((sum, count) => sum + count) * 20;
}