Given a word and a text, return the count of the occurrences of anagrams of the word in the text. For eg. word is “for” and the text is “forxxorfxdofr”, anagrams of “for” wi
I have taken two string namely str and occ. Str is the original strin and occ is the sting for which we have to find out the count. Using strncpy function I have copied the length of occ i.e. n chars into a temp array and then checked whether it is a permutation of the occ string or not.
#include
#include
#include
int permutate(char str1[],char str2[]);
int permutate(char str1[],char str2[]) {
int c[256]={0},i,j;
for(i=0;i