please help me with the approach of this question
Please help me with the approach of this question
approach
- First check if the length of string is less than the length of the given pattern, if yes then “ no such window can exist “.
- Store the occurrence of characters of the given pattern in a hash_pat[].
- Start matching the characters of pattern with the characters of string i.e. increment count if a character matches.
- Check if (count == length of pattern ) this means a window is found.
- If such window found, try to minimize it by removing extra characters from the beginning of the current window.
- Update min_length.
- Print the minimum length window.