Company: Hilti_31july
Difficulty: medium
Minimum Window Substring Problem Description You're given two strings S and T consisting of lowercase English alphabets. Find the length of the shortest substring in S that contains all the characters of T in any order. If no such substring exists, return -1. Note: A substring is a contiguous part of a string. Complete the solve function in the editor below. It has the following parameter(s): S : STRING - The given string. T : STRING - The given string. The function must return an INTEGER denoting the length of the shortest substring in S that contains all the characters of T in any order, else return -1. Examples Example 1: Input: S = "vgxfopakz", T = "xk" Output: 6 Explanation: We can select the substring of S = "xfopak", it satisfies the conditions given in the problem. Hence, its length is equal to 6. Example 2: Input: S = "rlvzmefifx", T = "uim" Output: -1 Explanation: There does not exist any substring of S which satisfies the conditions given in the problem. Hence, the answer is