Matrix
文章平均质量分 83
yuanhisn
这个作者很懒,什么都没留下…
展开
-
LeetCode 54 - Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] ...原创 2015-02-21 14:16:00 · 45 阅读 · 0 评论 -
Google Interview - Print Matrix Diagonally
Given a 2D matrix, print all elements of the given matrix in diagonal order. For example, consider the following 5 X 4 input matrix. 1 2 3 4 5 6 7 8 9 10 ...原创 2015-06-05 01:12:52 · 67 阅读 · 0 评论 -
Google Interview - Flowing Water
Given a N*N matrix contains lakes, each lake is represented by an elevation. The water in each lake can flow to its neighbours which has lower or equal elevations. Suppose the left and top side of t...原创 2015-06-15 09:19:59 · 60 阅读 · 0 评论 -
Find Islands
Given matrix MxN of 0s and 1s, return and output all groups of adjacent 1s in form of (row,col)... 1s are considered adjacent if they are adjacent horizontally or vertically. 1 1 0 1 0 1 1 1 1 1 ...原创 2015-06-24 11:22:07 · 97 阅读 · 0 评论