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 炸弹人的更多相关文章

  1. CareerCup Questions List 职业杯题目列表

    网站 www.careercup.com 上的题库列表 # Title Difficulty Company 1 Guards in a museum Hard F, G  2 Bomberman H ...

  2. [LeetCode] Boom Enemy 炸弹人

    Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return ...

  3. [CareerCup] 18.1 Add Two Numbers 两数相加

    18.1 Write a function that adds two numbers. You should not use + or any arithmetic operators. 这道题让我 ...

  4. [CareerCup] 17.2 Tic Tac Toe 井字棋游戏

    17.2 Design an algorithm to figure out if someone has won a game oftic-tac-toe. 这道题让我们判断玩家是否能赢井字棋游戏, ...

  5. [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 ...

  6. [CareerCup] 18.11 Maximum Subsquare 最大子方形

    18.11 Imagine you have a square matrix, where each cell (pixel) is either black or white. Design an ...

  7. [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 ...

  8. [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 ...

  9. [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 ...

随机推荐

  1. 多任务案例--文件夹copy.py

    import os import multiprocessing def copy_file(q,file_name,new_folder_name,old_folder_name): with op ...

  2. @select注解中可以用条件构造器

    https://mp.baomidou.com/guide/wrapper.html#lambda https://blog.csdn.net/weixin_42236404/article/deta ...

  3. 转,sql 50道练习题

    SQL语句50题   -- 一.创建教学系统的数据库,表,以及数据 --student(sno,sname,sage,ssex) 学生表--course(cno,cname,tno) 课程表--sc( ...

  4. BCB6常用快捷键

    :: 项目管理类 ::    F10                     代码窗口全屏显示时切换到BCB的主窗口    Ctrl + F12              打开源文件清单对话框    ...

  5. Java 集合介绍,常用集合类

    Java容器类类库的用途是“保存对象”,并将其划分为两个不同的概念: (1)Collection.一个独立元素的序列,这些元素都服从一条或多条规则.List必须按照插入的顺序保存元素,而Set不能有重 ...

  6. java创建数组几种方式

    最近得多学学基础了,基础还是很重要的- int[] temp=new int[6]; int[] temp={1,2,3,4}; int[] temp= new int[]{1,2,3,4,5};  ...

  7. Go by Example-图解数组

    基本概念 1.数组是具有相同唯一类型的一组已编号且长度固定的数据项序列,这种类型可以是任意的原始类型例如整形.字符串或者自定义类型. 2.在 Go 中因为数组的内存布局是连续的,所以可以通过索引(位置 ...

  8. Linux中工作目录切换命令

    1.pwd命令用于显示当前的工作目录 2.cd命令用于切换工作路径,格式为:cd [目录名称] 参数 作用 - 切换到上一次的 目录,如:cd - ~ 切换到”家目录“,如:cd ~ ~usernam ...

  9. Java 代码编写单例模式总结

    手写一个单例模式是 Java 面试中常见的问题,很多时候我们更偏向于简单的写一个饿汉或饱汉模式,深入研究的甚少,这里列举三种实现方式,并对各自的优缺进行分析. 1. 饿汉式 public class ...

  10. SpringBoot持久层技术

    一.Springboot整合mybatis maven中添加对数据库与mybatis的依赖 <dependencies> <dependency> <groupId> ...