leet-code/search-a-2d-matrix/sol.rs

5 lines
149 B
Rust
Raw Normal View History

2022-06-02 22:44:07 +00:00
impl Solution {
pub fn search_matrix(matrix: Vec<Vec<i32>>, target: i32) -> bool {
matrix.concat().binary_search(&target).is_ok()
}
}