public class Solution {
public int LeastBricks(IList<IList<int>> wall) {
if (wall.Count == )
{
return ;
}
int count = ;
Dictionary<int, int> map = new Dictionary<int, int>();
foreach (var list in wall)
{
int length = ;
for (int i = ; i < list.Count - ; i++)
{
length += list[i];
if (!map.ContainsKey(length))
{
map.Add(length, );
}
else
{
map[length]++;
}
count = Math.Max(count, map[length]);
}
}
return wall.Count - count;
}
}

https://leetcode.com/problems/brick-wall/#/description

最新文章

  1. css之浮动
  2. 使用 fixed role 授予权限
  3. windows系统调用 semaphore信号量
  4. Kindle 转换器
  5. SPRING IN ACTION 第4版笔记-第十一章Persisting data with object-relational mapping-002设置JPA的EntityManagerFactory(&lt;persistence-unit&gt;、&lt;jee:jndi-lookup&gt;)
  6. Hadoop MapReduce概念学习系列之shuffle大揭秘(十九)
  7. php删除最后一个字符
  8. c/c++将整数转换为字符串
  9. offsetWidth和clientWidth的介绍和区别
  10. 让IE6,7,8支持HTML5新标签的方法
  11. NSRange:NSMakeRange
  12. web项目中图标的前端处理方案
  13. 重启Apache报错
  14. c语言3种链接属性: 外部(external), 内部(internal),无设置(none)
  15. information_schema.COLUMNS
  16. openXML写Excel列组合
  17. Vue axios 返回数据绑定到vue对象问题
  18. Signal ()函数详细介绍
  19. ScrollView中嵌套GridView,Listview的办法
  20. 016-Go Iris Restful测试

热门文章

  1. jQuery 图片自动播放
  2. Qt类型转换
  3. 【ccf2017-12-2】游戏(模拟)
  4. 兄弟ifream的方法调用
  5. json结构更改的方法 把date有数据的分类
  6. android手机尺寸相关p107-p110
  7. nginx结合tomcat一起使用
  8. [置顶] Android逆向从未如此简单
  9. Go语言使用匿名结构体解析JSON数据
  10. static才是对代码的提升