Hi Friends,
Could you help me to solve this problem I have tried no luck.
we consider a string to be programmer string if some subset of its letters can be rearranged to form the word programmer.
for example , the strings “programmer”,“grammproer” and “xprozmerqgram” are all programmer strings. given a long string
,determine the indices within the string that are between two programmer strings as an example
s ="programmerxxxprozmerqgram"
the order of the letters does not matter . each of x character is between two programmer, so 3 indices meets test
s is [a-z]
1<s<10^5
example :
progxrammerrxproxgrammer
i =11 and i = 12
p r o g x r a m m e r r x p r o x g r a m m e r
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
there are two indices i = 11 and i = 12 that satisfy the property that substring s[0,i-1],s[i+1,n-1] are both programmer string