Can you help me? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can you help me?

Hi. I want to write a program that takes a string from the user, then gives the longest subroutine with the most repetition as output. And if two subfields are found that are the same in terms of repetition and height, the one that is alphabetically later should be used as the output. I have no idea about the question. Can you help me? For example: Input: poslpos Output: pos

27th Nov 2021, 11:51 AM
Marjaf
Marjaf - avatar
3 Answers
+ 6
Marjaf , are you allowed to use a python library that is a part of the python distribution?
27th Nov 2021, 2:45 PM
Lothar
Lothar - avatar
+ 1
Frist u need to define the characteristics of ur subroutine..... Then work from there
27th Nov 2021, 11:55 AM
Ramprasad
Ramprasad - avatar
+ 1
Marjaf You referenced python in your tag so what do you need to do in python to accomish the task? So break it down into pieces. First you need a string to store input. Second you need to take input. myString = input() What you describe above sound like one of the Sololearn code projects/challenges. Generally the lessons before each give you the tools to complete the task. So you can go back and review them to build your solution. You can also Google "how to declare a string in python" and "how to take input in python" Then continue the process. I assume you meant substring and not subroutine. So next review the Sololearn lessons on string handling or search on Google for "find substring in python" Then keep working through each item needed to complete the code. Jump in you can do it! And happy coding! 😊
27th Nov 2021, 2:20 PM
Paul K Sadler
Paul K Sadler - avatar