From 17e37c823dbfc0f9576d2719b77f52e5cfa1e830 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Thu, 2 Jun 2022 23:44:07 +0100 Subject: [PATCH] search-a-2d-matrix --- search-a-2d-matrix/sol.rs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 search-a-2d-matrix/sol.rs diff --git a/search-a-2d-matrix/sol.rs b/search-a-2d-matrix/sol.rs new file mode 100644 index 0000000..3005781 --- /dev/null +++ b/search-a-2d-matrix/sol.rs @@ -0,0 +1,5 @@ +impl Solution { + pub fn search_matrix(matrix: Vec>, target: i32) -> bool { + matrix.concat().binary_search(&target).is_ok() + } +} \ No newline at end of file