Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chessTriangle = (height, width) => [[2, 3, 8], [2, 4, 8], [4, 3, 8],[4, 2, 8], [3, 2, 8], [3, 4, 8], [3, 3, 16]]
- .filter(([x,y,a]) => width >= x && height >= y).reduce((mem,[x,y,a]) => (1+width-x)*(1+height-y)*a+mem,0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement