542/

directory
v0.0.0-...-9b92ec5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: MIT

README

01 矩阵

给定一个由 0 和 1 组成的矩阵,找出每个元素到最近的 0 的距离。

两个相邻元素间的距离为 1 。

 

示例 1:

` 输入: [[0,0,0], [0,1,0], [0,0,0]]

输出: [[0,0,0],  [0,1,0],  [0,0,0]] `

示例 2:

` 输入: [[0,0,0], [0,1,0], [1,1,1]]

输出: [[0,0,0], [0,1,0], [1,2,1]] `

 

提示:

  • 给定矩阵的元素个数不超过 10000。
  • 给定矩阵中至少有一个元素是 0。
  • 矩阵中的元素只在四个方向上相邻: 上、下、左、右。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL