thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

average without overflow

β€’ 24 words β€’ 1 min β€’ updated

With potential overflow:

python
mid = (left + right) // 2

With no overflow:

python
mid = left + (right - left) // 2