write a program to check the overlapping of one string's suffix with the prefix of another string
1.Sample input:
ramisgood
goodforall
Sample Output:
good
2.Sample input:
finally
restforall
sample input:
No overlapping
w_1 = input() w_2 = input() if len(w_1) > len(w_2): i = len(w_2) else: i = len(w_1) overlap = "" while i > 0: if w_1[len(w_1)-i:] == w_2[:i]: overlap = w_2[:i] break i -= 1 if len(overlap) > 0: print(overlap) else: print("No overlapping")
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!