Company: Lumber_4aug
Difficulty: medium
Shortest Substring to Make Distinct Characters Problem Description You are given a string s of length n made of lowercase English letters. You may delete exactly one substring of s (a block of consecutive characters, possibly empty). The characters before the deleted block and the characters after it are then joined together, in their original order. Your goal is to make every character of the remaining string distinct , that is, no letter may appear in it more than once. Find the length of the shortest substring whose deletion achieves this. If s already has only distinct characters, nothing needs to be deleted and the answer is 0 . Complete the function findShortestSubstring , which takes the string s and returns the length of the shortest substring that should be deleted. Input Format Read from standard input. s The only line contains the string s . (inferred -- the source shows the string alone on one line, with no length line before it.) Output Format Print a single integer: the l