Skip to content

Commit 04ec171

Browse files
authored
Create 0176_Problem_1.swift
1 parent a8b703e commit 04ec171

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: 0176_Problem_1.swift

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// code_report Solution
2+
// Problem Link (Contest): https://leetcode.com/contest/weekly-contest-176/problems/count-negative-numbers-in-a-sorted-matrix/
3+
// Problem Link (Practice): https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix/
4+
5+
func countNegatives(_ grid: [[Int]]) -> Int {
6+
return grid.flatMap{ $0 }
7+
.filter{ $0 < 0 }
8+
.count
9+
}

0 commit comments

Comments
 (0)