few of my test cases are not passing!
Few of my test cases are not passing!
Hey
Can you post your code?
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
where am i suppposed to post my code!in order to get it checked sicnce few of the test cases are not passed
Paste your code on coding blocks ide and save it . A link will get generated copy it and send it here
Here is the algorithm to solve this problem:
- First check if length of string is less than the length of given pattern, if yes then "no such window can exist ".
- Store the occurrence of characters of 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 beginning of current window.
- Update min_length
- Print the minimum length window.
u can check from here what is wrong with your code