Company: LinkedIn_SDE intern_On-campus_6july
Difficulty: medium
Given a string, identify substrings that satisfy the following conditions: The length of the substring must be within the inclusive range [minLength, maxLength]. The number of unique characters in the substring must not exceed maxUnique. Based on these conditions, find the frequency of the most frequently occurring substring. Example components = 'abcde' minLength = 2 maxLength = 3 maxUnique = 3 The given string components is 'abcde'. The number of pieces in an interval should be greater than or equal to minLength = 2, so 'a', 'b', 'c', 'd', and 'e' are discarded. The combination of characters should be less than or equal to maxLength = 3, so 'abcd', 'bcde', and 'abcde' are discarded. The intervals that satisfy the conditions above are 'ab', 'bc', 'cd', 'de', 'abc', 'bcd', and 'cde'. Each combination of characters occurs only one time, so the maximum number of occurrences is 1. Function Description Complete the function getMaxOccurrences in the editor with the following parameter(s): s