As usual, binary search is hard to get right. This time I was never actually selecting between left and right when they were just one character apart.
5Q6NIG66SI7CS33S2TVIWSLLICWVAINELJJTMNR2UBWVZPGB7DZAC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
EX3GRC2KYJJ5XDNWZNSJMT3G23WFCKZSB6B5HDFL6WG2YHHGDXCQC
BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC
while left < right-1 do
--? print('--') while true do
--? print('--')
while true do
--? print(x, left, right, curr, currxmin, currxmax)
if left >= right-1 then return right end
if left >= right-1 then
return right
end
assert(false)
click on first character of text -> cursor on first character of text