Given two strings, a parent string and a query string respectively, your task is to determine how many times the query string, or an anagram of the query string; appears in the parent string, in a case-sensitive search.
Examples of Behaviour
Input 1
AdnBndAndBdaBn
dAn
Output 1
4
Explanation The substrings are highlighted in bold below:
AdnBndAndBdaBn
AdnBndAndBdaBn
AdnBndAndBdaBn
AdnBndAndBdaBn
Note the search MUST be case sensitive for all searches.
Input 2
AbrAcadAbRa
cAda
Output 2
2
This must work for standard ASCII only. This is code-golf, so shortest number of characters will get the tick of approval. Also please post a non-golfed version of your code along with the golfed version.
abacacaba
aac
\$\endgroup\$