What is Off-by-one error?
A mistake in which a loop count or an array range is off by exactly one. It arises from whether the final value is included, whether indices start at 0 or 1, and confusing the number of intervals with the number of points (the fence-post problem). Tracing with the boundary values makes it easier to find.
Japanese name: オフバイワンエラー
Off-by-one error appears in 2 practice questions across 1 topic, including Programming Basics (Pseudocode Tracing).