Skip to content

Glossary: Coding Interviews in C++

Off-by-one error

Also written: off by one

A bug where a count or range is wrong by exactly one, such as a window's length written `right - left` instead of `right - left + 1`. Trace tables and edge cases catch it.

Where the book teaches it

Related terms

Trace tableSliding windowEdge case