562. Longest Line of Consecutive One in Matrix (3D DP)
brute force:
T: O(mn)
S: O(1)
針對四種 case 去寫, 但 code 會太長,
有效計算對角線的座標:
https://www.cnblogs.com/grandyang/p/6900866.html
3-D DP
T: O(mn)
S: O(4mn)
Last updated
Was this helpful?
T: O(mn)
S: O(1)
針對四種 case 去寫, 但 code 會太長,
有效計算對角線的座標:
https://www.cnblogs.com/grandyang/p/6900866.html
T: O(mn)
S: O(4mn)
Last updated
Was this helpful?