Skip to content

dist [terminology]

Terminology

Usage

  • Use for distances or a table of distances.
  • It may be a scalar or collection, but the surrounding type should make that distinction clear.
  • Prefer it over res when the returned collection specifically represents distances.
dist = [[-1] * n for _ in range(m)]
dist[nr][nc] = dist[r][c] + 1