Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE_120 Sir_it_is_urgent.do_fast._Please_solve_this_code_in_python3_paste_with_proper_intendent_blocks_bypressing(CTRL+SHIFT+V),Also_please_provide_code_screenshot,_Thank_you. Do_not_need_comments. SKIP_BUILT_IN_FUNCTIONS. Just_give_me_solution_as_fast_as_possible._I_am_running_out_of_time._Attach_a_screenshot_with_yoursolve. Question-1: Write a python code that takes a string as an user input and finds out all the duplicate characters

CSE_120

Sir_it_is_urgent.do_fast._Please_solve_this_code_in_python3_paste_with_proper_intendent_blocks_bypressing(CTRL+SHIFT+V),Also_please_provide_code_screenshot,_Thank_you.

Do_not_need_comments. SKIP_BUILT_IN_FUNCTIONS. Just_give_me_solution_as_fast_as_possible._I_am_running_out_of_time._Attach_a_screenshot_with_yoursolve.

Question-1: 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' ================================================ Sample Input 02: Programming is not fun

Sample Output 02: new_list = ['gg', 'ii', 'mm', 'nnn', 'oo', 'rr']

shortest = 5

Explanation 02: Substrings of duplicate characters of the given string are 'rr', 'oo', 'gg', 'mm', 'ii', 'nnn'. Sort them in ascending order and there are multiple shortest substring available thats why printing the total number of shortest substring.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Discuss attention and its role in message processing.

Answered: 1 week ago

Question

Which supplier did the company purchase the most from?

Answered: 1 week ago

Question

Would management want these numbers to be higher or lower?

Answered: 1 week ago

Question

What do you consider abnormally high? Are these suspicious?

Answered: 1 week ago