I have this string abcpdxypabcdc
I like this
abc=2 //repeated number of times
p=2 //...
d=2 //...
xy=1 //...
c=1 //...
Since its length will be known. In function I will get pointer having pointing to abcpdxypabcdc
string and length of string which in this case will be 13.
I like algorithm for it. I have tried it but I like to know what will be the correct to proceeding to solving these problems if I like to do it with pointers. I need explanation how to solve these types of problems
I think I need to maintain some struct with index
where the each pattern start and a number that contains number of times the pattern is found in string so far.
Plus second loop to check each array of struct contains duplicated items. But I like to know what is the correct way of solving these coding examples.