Determine the length of the shortest substring to delete from a string s of length n, so that the resulting string contains only distinct characters.
A substring is a sequence of characters that appear consecutively within a string. If a substring is deleted, the remaining parts of the string are joined together. If no deletion is necessary, the answer should be 0.
s = "abcbbck" There are three optimal choices: "abcbbck", "abcbbck", and "abcbbck". The bold characters are the substrings to remove. All result in "abck" which has only distinct characters. The removed substring must have at least 3 characters. Return 3.
Complete the function findShortestSubstring in the editor with the following parameter:





