Skip to content

Glossary: Coding Interviews in Java

Off-by-one error

Also written: off by one

A bug where a count or index is wrong by exactly one, such as measuring a window's length as `right - left` instead of `right - left + 1`. A trace table on a small example reveals it.

Where the book teaches it

Related terms

Trace tableSliding window