标签:java stream href color turn bsp com ati port
https://www.codewars.com/kata/how-many-stairs-will-suzuki-climb-in-20-years/train/java
import java.util.Arrays; public class Kata { public static long stairsIn20(int[][] stairs) { return 20 * Arrays.stream(stairs).flatMapToInt(arr -> Arrays.stream(arr)).sum(); } }
My Solution :
public static long stairsIn20(int[][] stairs) { long result = 0; for (int i = 0; i < stairs.length; i++) { for (int j = 0; j < stairs[i].length; j++) { result += stairs[i][j]; } } return result * 20; }
标签:java stream href color turn bsp com ati port
原文地址:https://www.cnblogs.com/ukzq/p/11202670.html