@@ -0,0 +1,589 @@
+'''%0D%0ASuppose we have two Strings :- Pattern and Text%0D%0Apattern: consisting of unique characters%0D%0Atext: consisting of any length%0D%0AWe need to find the number of patterns that can be %0D%0Aobtained from text removing each and every occurrence of Pattern in the Text.%0D%0AInput : %0D%0APattern : ABC%0D%0AText : ABABCABCC%0D%0AOutput :%0D%0A3%0D%0A'''%0D%0A%0D%0Apatternx = 'ABC'%0D%0AtextA = 'ABABCABCC'%0D%0Acount = 0%0D%0Awhile textA.find(patternx) != -1:%0D%0A    posit = textA.find(patternx)%0D%0A    listA = list(textA)%0D%0A    listTemp = listA%5B:posit%5D + listA%5Bposit + len(patternx):%5D%0D%0A    textA = %22%22.join(listTemp)%0D%0A    count +=1%0D%0Aprint(count)%0D%0A

Add files via upload