Skip to content

m / n [terminology]

Terminology

Usage

  • Use n for the size of a one-dimensional sequence.
  • Use m and n for matrix dimensions:
    • m: number of rows
    • n: number of columns
  • Do not use n as a generic element variable.
  • Cache the size when it is used repeatedly or makes loop bounds clearer.
n = len(nums)

m, n = len(matrix), len(matrix[0])