[LeetCode] Longest Line of Consecutive One in Matrix 矩阵中最长的连续1

Posted Grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[LeetCode] Longest Line of Consecutive One in Matrix 矩阵中最长的连续1相关的知识,希望对你有一定的参考价值。

 

Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal.

Example:

Input:
[[0,1,1,0],
 [0,1,1,0],
 [0,0,0,1]]
Output: 3

 

Hint: The number of elements in the given matrix will not exceed 10,000.

 

s

 

以上是关于[LeetCode] Longest Line of Consecutive One in Matrix 矩阵中最长的连续1的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode 562. Longest Line of Consecutive One in Matrix(在矩阵中最长的连续1)$

3. Longest Substring Without Repeating Characters

LeetCode题解 || Longest Substring Without Repeating Characters (O(n)算法)问题

562. Longest Line of Consecutive One in Matrix

LeetCode 14. Longest Common Prefix

LeetCode OJ 5 Longest Palindromic Substring