Company: iragecapital
Difficulty: easy
Unsigned Underflow in a Vector Bound What is the classic latent bug in the condition `while (i < v.size() - 1)` for a `std::vector v`? It skips the last element. `size()` returns an unsigned type, so when `v` is empty, `size() - 1` wraps around to a huge value. `size()` is O(n) for vectors. It causes an infinite loop when `v` has one element.