• + 1 comment

    The fastest solution is O(n) and it requires only 26 bit slots for storage. There is no need to find the shortest string which will make the process takes longer time. O(n) is already the fastest solution because you need to read every characters.