## DEV Community is a community of 601,094 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

# Discussion on: Coding Puzzles: Week of 4/8

Ali Spittel

Monday (8KYU): How many stairs will Suzuki climb in 20 years?

codewars.com/kata/56fc55cd1f5a93d6...

Md Imrul Hassan
``````def stairs_in_20(stairs):
return 20*sum(sum(stairs, []))
``````
Laurie • Edited

Javascript (ES6):

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

Not a one liner like you guys but C#:

``````using System;
public class Kata
{
public static long StairsIn20(int[][] stairs)
{
long sum = 0;
foreach (var weekday in stairs)
foreach (var steps in weekday)
sum += steps;

return sum * 20;
}
}
``````
Jelle Bekker

Okay, I couldn't help myself:

``````using System;
using System.Linq;

public class Kata
{
public static long StairsIn20(int[][] stairs)
{
return stairs.SelectMany(x => x).Sum() * 20;
}
}
``````
Ali Spittel • Edited

My Python solution:

``````def stairs_in_20(stairs):
return sum(i for sublist in stairs for i in sublist)  * 20
``````
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);
}