1 Star 0 Fork 0

agony/LeetCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
221.MaximalSquare.Test.cs 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
Kai Yang 提交于 2015-08-15 13:33 . Add shared code
using Newtonsoft.Json;
using NUnit.Framework;
[TestFixture]
public class MaximalSquareTest
{
[TestCase("[]", 0)]
[TestCase("[['0']]", 0)]
[TestCase("[['1']]", 1)]
[TestCase(@"[['0','1'],
['0','0']]", 1)]
[TestCase(@"[['0','1'],
['0','1']]", 1)]
[TestCase(@"[['0','1'],
['1','0']]", 1)]
[TestCase(@"[['0','1'],
['1','1']]", 1)]
[TestCase(@"[['1','0'],
['1','1']]", 1)]
[TestCase(@"[['1','1'],
['1','1']]", 4)]
[TestCase(@"[['1','0','1','0','0'],
['1','0','1','1','1'],
['1','1','1','1','1'],
['1','0','0','1','0']]", 4)]
[TestCase(@"[['1','0','1','0','0'],
['1','0','1','1','1'],
['1','1','1','1','1'],
['1','1','1','1','1'],
['1','0','0','1','0']]", 9)]
[TestCase(@"[['1','1','0','0','0'],
['1','1','1','0','0'],
['0','1','1','1','0'],
['0','0','1','1','1'],
['0','0','0','1','1']]", 4)]
[TestCase(@"[['1','1','1','1','1','1','1','1'],
['1','1','1','1','1','1','1','0'],
['1','1','1','1','1','1','1','0'],
['1','1','1','1','1','0','0','0'],
['0','1','1','1','1','0','0','0']]", 16)]
public void Test(string matrixString, int expectedArea)
{
var matrix = JsonConvert.DeserializeObject<char[,]>(matrixString);
var result = new Solution().MaximalSquare(matrix);
Assert.AreEqual(expectedArea, result);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/agony2020/LeetCode.git
git@gitee.com:agony2020/LeetCode.git
agony2020
LeetCode
LeetCode
master

搜索帮助