Practice · 1 of 1
Overflow-Safe Addition
CHALLENGE
Difficulty: advanced+25 XP
Implement addChecked: returns the sum, or std::nullopt when it would overflow — for every signed combination, including INT_MAX/INT_MIN extremes. No signed overflow may occur in your implementation (pre-check, don't post-detect).
Press Submit to check your solution.
Back to lesson: Practice: Practice: Checked Boundaries