DEV Community

loading...

Discussion on: Coding Puzzles: Week of 4/8

Collapse
clandau profile image
Courtney

Practicing TypeScript for my upcoming internship. And I figured out how to add code highlighting!

function stairsIn20(stairs : number[][]) : number {
    let totalStairs : number = 0;
    for(let day of stairs) {
      totalStairs += day.reduce((total, num) => total + num);
    }
    return totalStairs * 20;
  }