We are given with the two strings let’s say str1 and str2 and the task is to find the count of common characters in two strings i.e. if str1[i] = str[j], then they will be considered as a pair and count will i
In fact, there can be '1's in between those two '1's picked up.Thus, number of substrings starting with '1' & ending with '1' , where count is the frequency of '1's in the string. So for our above example:Input string: 100110100 Number of '1's=4 Thus total number of sub...
Given a stringSand a wordC, return thecount of the occurrences of anagramsof the word in the text. Both string and word are in lowercase letter. Examples Input: S=fororfrdofr C=for Output: 3 Input: S=aabaabaa C=aaba Output: 4 ...