what does the line hash_pat[pat[i]]++ mean
What does the line hash_pat[pat[i]]++ mean
hash_pat is a hashmap for the character to frequency mapping of the pattern.
So hash_pat[pat[i]]++ means that the frequency of character pat[i] is being incremented in the map by 1.
also will it be possible to give the code of brute force approach
code is not available with us. You can try it yourself. If you are not able then you can post it as a doubt.
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.