Had an interesting application of binary search come up discussing a possible solution to a problem, wondering what different implementations people would come up with if presented with it. Boiled down to a basic (but maybe silly) form, the problem is: use binary search to find the intervals of identical alphabetical characters in a string.
Example input: `'00aaaaaaaaaaa000bbbbbbb0000000000000000cccc000000000'`
Example output: `[(2, 12), (16, 22), (39, 42)]`
The intervals (2, 12) are the (inclusive) intervals of the character 'a', (16, 22) the same for 'b', and (39, 42) the same for 'c'. …