This is a verified interview question from Goldman-sachs. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Goldman Sachs Quant Role Online Assessment MCQS PYQS DSA" covers key patterns like Strings.
"### Problem 1 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. ### Example 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. ### Function Description Complete the function findShortestSubstring in the editor with the following parameter: - s: the string to analyze ### Returns: - int: an integer representing the length of the shortest substring that should be deleted ### Constraints - 1 ≤ n ≤ 10^5 - s consists of lowercase English letters only.  ### Problem 2  ### MCQS    "
Join thousands of developers practicing for Goldman-sachs.