Skip to content

Instantly share code, notes, and snippets.

@Woodsphreaker
Last active March 18, 2017 17:20
Show Gist options
  • Save Woodsphreaker/cb5d675744b0b0b11aaba111200d586e to your computer and use it in GitHub Desktop.
Save Woodsphreaker/cb5d675744b0b0b11aaba111200d586e to your computer and use it in GitHub Desktop.
Count Negative Integers in Matrix
"use strict";
const arr = [[-1, 3, 4, 1], [2, 2, 4, 9], [4, 5, -7, 9]];
const flatten = [].concat(...arr);
const find = () => flatten.filter(_a => _a < 0).length;
console.log(find()) //2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment