early exit
RU: ранний выход
Stopping a loop or function as soon as the answer is known, without processing remaining elements. Improves best-case performance (O(1) if found immediately) but does not change worst-case Big-O (still O(n) if not found).
RU: ранний выход
Stopping a loop or function as soon as the answer is known, without processing remaining elements. Improves best-case performance (O(1) if found immediately) but does not change worst-case Big-O (still O(n) if not found).