Company: Zscalar_2march
Difficulty: medium
Shortest Substring Problem Description Determine the length of the shortest substring to delete from a string s of lowercase English letters such that the resulting string contains only distinct characters. A substring is a sequence of characters that appear consecutively in a string. If a substring is deleted, the remaining parts of the string are joined together. If no deletion is necessary, the answer is 0. Complete the function findShortestSubstring in the editor with the following parameter: s : the string to analyze Returns: An integer representing the length of the shortest substring that should be deleted. def findShortestSubstring(s): # Write your code here pass Examples Example 1: Input: s = "kbbcbpcpr" Output: 3 Explanation: Given string s = "kbbcbpcpr" , if we remove the substring 'bcb', the remaining parts 'kbb' and 'pcpr' join to form 'kbbpcpr'. This new string 'kbbpcpr' contains only distinct characters. The length of 'bcb' is 3. Example 2: Input: s = "abc" Output: 0 Exp