[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 ...
随机推荐
- 除了不要 SELECT * ,程序员使用数据库还应知道的11个技巧
SQL:sum里加条件SELECT SUM( CASE WHEN "V7010" BETWEEN 0 AND 0.1 THEN 1 ELSE 0 END) FROM "C ...
- python实现字符串中如果遇到连续重复的字符只出现一次非去重
需求:在一个字符串中, 如果遇到连续重复的字符只出现一个,(不是去重) 例:str1 = 'aabbccddaabbccdd' 输出结果为:‘abcdabcd’ 具体实现代码如下: def func( ...
- python - scrapy 爬虫框架(创建, 持久化, 去重, 深度, cookie)
## scrapy 依赖 twisted - twisted 是一个基于事件循环的 异步非阻塞 框架/模块 ## 项目的创建 1. 创建 project scrapy startproject ...
- Linux - 网络配置( CentOS 64 )
终于..今天我终于将linux的网络调试出来了,虽然之前看了一大堆教程,每一个都是一样的步骤,但是,在我这就是弄不好,所以经过不断尝试的我,今天发一个自己配置好的步骤,唉,太痛苦了. - 对了补充一句 ...
- 007——转载——C#将字符串转换为整型的三种方法的总结
(一)转载——C#将字符串转换为整型的三种方法的总结 在C#中,要将一个字符串或浮点数转换为整数,基本上有三种方法: (1)使用强制类型转换:(int)浮点数 (2)使用Convert.ToInt32 ...
- LibreOJ #6. Guess Number
二次联通门 : LibreOJ #6. Guess Number /* LibreOJ #6. Guess Number 交互题初体验 用了二分判定 感觉不错 */ #include "in ...
- hbuilder mui html vue ul li 自定义循环赋值ID
<ul class="mui-table-view mui-table-view-chevron"> <li class="mui-table-view ...
- C++中的平方、开方、绝对值怎么计算
#include <math.h> //平方 pow() ,);// 4的平方=16 //开方 ,0.5);// 4的平方根=2 );// 4的平方根=2 //整数绝对值 int c = ...
- ZR#957
ZR#957 解法: 首先 $ T $ 必须得要是 $ S $ 的子序列,不然不存在好的下标序列,因此一定无解. 考虑判断一个串 $ T $ 是不是 $ S $ 子序列的贪心做法:每次从没有匹配的位置 ...
- tez 0.9.0 配置
官网: https://tez.apache.org/releases/0.9.0/tez-api-javadocs/configs/TezConfiguration.html