Question: Write a python code that takes a string as an user input and finds out all the duplicate characters and makes consecutive substrings with the

Write a python code that takes a string as an user input and finds out all the duplicate characters and makes consecutive substrings with the duplicates found in the given string and appends in a list. Sort the list in ascending order and print as output. If you find ONLY one shortest substring print that too, otherwise print the number of shortest substrings. You should handle every uppercase and lowercase character and exclude the spaces.. [You can not use sort() or sorted(), min() function here.] ================================================ Sample Input 01: It is a rainy day Sample Output 01: new_list = ['aaa', 'iii', 'yy'] shortest = yy Explanation 01: Substrings of duplicate characters of the given string are 'iii', 'aaa' and 'yy'. Sorting them in ascending order and the shortest substring is 'yy'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!