Algorithmic task
Given a string of length 1048576, find the position of the longest substring made from identical characters. It is guaranteed that there is only one such substring and its length is 8192. You are not allowed to peek inside the string, however you can call an external function "getMaxLength(int startPosition, int endPosition)" which will return the longest number of identical consecutive characters found within the interval. Describe your solution in code or prose.