problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::max_area_of_island 命名空间参考

LeetCode 695. Max Area of Island 更多...

class  Solution
 
class  UnionFind
 

函数

 TEST (max_area_of_island, case1)
 
 TEST (max_area_of_island, case2)
 

详细描述

LeetCode 695. Max Area of Island

函数说明

◆ TEST() [1/2]

leetcode::max_area_of_island::TEST ( max_area_of_island  ,
case1   
)

在文件 leetcode_test.cpp2159 行定义.

2159 {
2160 vector<vector<int>> input = {{0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
2161 {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
2162 {0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
2163 {0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0},
2164 {0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0},
2165 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
2166 {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
2167 {0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}};
2168 ASSERT_EQ(6, Solution::maxAreaOfIsland(input));
2169 }

引用了 leetcode::max_area_of_island::Solution::maxAreaOfIsland().

◆ TEST() [2/2]

leetcode::max_area_of_island::TEST ( max_area_of_island  ,
case2   
)

在文件 leetcode_test.cpp2171 行定义.

2171 {
2172 vector<vector<int>> input = {{0, 0, 0, 0, 0, 0, 0, 0}};
2173 ASSERT_EQ(0, Solution::maxAreaOfIsland(input));
2174 }

引用了 leetcode::max_area_of_island::Solution::maxAreaOfIsland().