def dup(str, n, newstr="", index=0, p=0):
if index == n-1:
newstr = newstr + str[p:n]
print(newstr)
return
if str[index] == str[index+1]:
newstr = newstr + str[p:index+1] + “*” + str[index+1]
p = index+2
dup(str, n, newstr, index+1, p)
dup(“hello”, 5)