摘要: Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in 阅读全文
posted @ 2016-09-12 07:19 咖啡中不塌缩的方糖 阅读(128) 评论(0) 推荐(0) 编辑
摘要: You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos 阅读全文
posted @ 2016-09-12 01:06 咖啡中不塌缩的方糖 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2016-09-12 00:29 咖啡中不塌缩的方糖 阅读(138) 评论(0) 推荐(0) 编辑