[CareerCup] 2. Bomberman 炸弹人
We have a 2D grid. Each cell is either a wall, an enemy or empty.
For example (0-empty, X-enemy, Y-wall):
0 X 0 0
X 0 Y X
0 X 0 0
You have one bomb and you want to kill as many as possible enemies with it. The bomb will kill all the enemies in the same row and column from the planted point until it hits the wall since the wall is too strong to be destroyed.
Given such a grid, return the maximum enemies you can kill with one bomb.
Note that you can only put the bomb at empty cell.
In the example, if you put a bomb at (1,1) you will kill 3 enemies which is the best you can get. You can not kill the guy behind the wall at (1,3).
这个题实质是LeetCode上的 361. Bomb Enemy
CareerCup Questions List 职业杯题目列表
[CareerCup] 2. Bomberman 炸弹人的更多相关文章
- CareerCup Questions List 职业杯题目列表
网站 www.careercup.com 上的题库列表 # Title Difficulty Company 1 Guards in a museum Hard F, G 2 Bomberman H ...
- [LeetCode] Boom Enemy 炸弹人
Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return ...
- [CareerCup] 18.1 Add Two Numbers 两数相加
18.1 Write a function that adds two numbers. You should not use + or any arithmetic operators. 这道题让我 ...
- [CareerCup] 17.2 Tic Tac Toe 井字棋游戏
17.2 Design an algorithm to figure out if someone has won a game oftic-tac-toe. 这道题让我们判断玩家是否能赢井字棋游戏, ...
- [CareerCup] 18.12 Largest Sum Submatrix 和最大的子矩阵
18.12 Given an NxN matrix of positive and negative integers, write code to find the submatrix with t ...
- [CareerCup] 18.11 Maximum Subsquare 最大子方形
18.11 Imagine you have a square matrix, where each cell (pixel) is either black or white. Design an ...
- [CareerCup] 18.10 Word Transform 单词转换
18.10 Given two words of equal length that are in a dictionary, write a method to transform one word ...
- [CareerCup] 18.9 Find and Maintain the Median Value 寻找和维护中位数
18.9 Numbers are randomly generated and passed to a method. Write a program to find and maintain the ...
- [CareerCup] 18.8 Search String 搜索字符串
18.8 Given a string s and an array of smaller strings T, design a method to search s for each small ...
随机推荐
- vs编译自定义编译任务记录,msbuild
https://www.cnblogs.com/whitewolf/archive/2011/07/27/2119005.html http://www.cnblogs.com/hjf1223/arc ...
- linux mint 19.1安装搜狗输入法
1.到搜狗拼音输入法官网下载Linux版. 2.使用dpkg命令安装deb软件包: $ sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb 3.安装成功;也有可 ...
- 基于JSON的接口测试框架
更多学习资料请加QQ群: 822601020获取 实现效果 需求场景: 公司微服务接口使用数字签名的方式, 使用Postman调试接口每次都需要修改源码将验签临时关闭, 但是关闭后,其他微服务不能正常 ...
- 数据层面;MySQL查
AND 运算优先于OR运算执行(通过括号进行强化) count(*) 会得到包含NULL的数据行数:count(<列明>)会得到NULL之外的数据行数 SQL语句的总逻辑:书写顺序 sel ...
- angularJs driective指令小实例
做一个下拉菜单,体会指令各参数的作用 html代码 <script type="text/ng-template" id="mydropdown.html" ...
- Hadoop界的Hello World!
Hadoop界的Hello World! 2019-05-20 19:50:09 应用平台:Eclipse+ubantu+hadoop包 注:例分析的形式给宝宝们解释一下,详细运行过程省略. 实例: ...
- java四种对象引用类型
java四种对象引用类型 对象的强.软.弱和虚引用 在JDK 1.2以前的版本中,若一个对象不被任何变量引用,那么程序就无法再使用这个对象.也就是说,只有对象处于可触及(reachable)状态,程序 ...
- C# 控制反转
主要目的:需要在业务逻辑层调用UI的弹框提示信息代码是在记事本中写的,没有运行调试过,不保证能直接使用,看下思路就好 //接口public interface IShowData { void Sho ...
- CentOS定时运行脚本
1,新增脚本 如: vim /usr/local/crontab/clear_tomcat_log.sh 2, 修改权限 chomd 700 clear_tomcat_log.sh 3,调度任务: ...
- nessus在Linux上的安装
Nessus有三种安装方式 1.源文件安装 源文件安装是最复杂的安装方式,用此方式安装可以修改配置参数. 2.rpm安装 rpm安装比起源文件安装更简单一些,它已经把一些底层的东西写好了,用户只要按步 ...