Print common characters using Python
Given two strings, write code to print overlapping letters in alphabetical order.
#Given the following strings: str1 = 'card' str2 = 'shark' #Your overlapping letters would be 'a' (1x) and 'r' (1x), #and they just happen to be in alphabetical order already, #so your code would return: 'ar'
If there is no overlap between the two strings, you can print 'no overlap'.
Subscribe to premium account to see the solution.Get premium now