From 8cbaccaa1f5409b702a1099bf24ee3a99a32c10c Mon Sep 17 00:00:00 2001 From: zhirshya <36841010+zhirshya@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:08:50 +0900 Subject: [PATCH 1/2] Update Solution2.cpp Removed an unnecessary directions declaration: vector dirs = {-1, 0, 1, 0, -1}; --- solution/0200-0299/0200.Number of Islands/Solution2.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/solution/0200-0299/0200.Number of Islands/Solution2.cpp b/solution/0200-0299/0200.Number of Islands/Solution2.cpp index 3b1157ec545e9..82520951cee74 100644 --- a/solution/0200-0299/0200.Number of Islands/Solution2.cpp +++ b/solution/0200-0299/0200.Number of Islands/Solution2.cpp @@ -9,7 +9,6 @@ class Solution { grid[i][j] = '0'; queue> q; q.push({i, j}); - vector dirs = {-1, 0, 1, 0, -1}; while (!q.empty()) { auto [a, b] = q.front(); q.pop(); @@ -33,4 +32,4 @@ class Solution { } return ans; } -}; \ No newline at end of file +}; From c47039e72e0c7fcc515b3446df062b203b80b28b Mon Sep 17 00:00:00 2001 From: Libin YANG Date: Mon, 8 Dec 2025 10:53:29 +0800 Subject: [PATCH 2/2] Update Solution2.cpp --- solution/0200-0299/0200.Number of Islands/Solution2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/0200-0299/0200.Number of Islands/Solution2.cpp b/solution/0200-0299/0200.Number of Islands/Solution2.cpp index 82520951cee74..4ff04b9ef0736 100644 --- a/solution/0200-0299/0200.Number of Islands/Solution2.cpp +++ b/solution/0200-0299/0200.Number of Islands/Solution2.cpp @@ -5,7 +5,7 @@ class Solution { int n = grid[0].size(); int ans = 0; int dirs[5] = {-1, 0, 1, 0, -1}; - function bfs = [&](int i, int j) { + auto bfs = [&](int i, int j) -> void { grid[i][j] = '0'; queue> q; q.push({i, j});