You are given a string of n characters from the range a–z.
Your task is to find out how long is the shortest string that does not appear as a contiguous substring in the given string.
You may assume that n is at most 10^5.
In a file nostring.py
, implement a function find
that returns the length of the missing string.
def find(s): # TODO if __name__ == "__main__": print(find("zzz")) # 1 print(find("aybabtu")) # 1 print(find("abcdefghijklmnopqrstuvwxyz")) # 2