3 ms·
This algorithm is effectively like 2 people dividing N cookies using the cut/choose method. Each side will both cut and choose N/2 times. If N isn’t tiny then w
by alkonaut 8y ago
This algorithm is effectively like 2 people dividing N cookies using the cut/choose method. Each side will both cut and choose N/2 times. If N isn’t tiny then worst case it’s odd (e.g 17 for PA).