Read the input, find the starting index of the substring old, then search backward from the end of the string for the same substring, and print the bigger value of the two.
Search in a string
The beginning or the end?
Report a typo
Sample Input 1:
old macdonald had an old farmSample Output 1:
21Write a program in Python 3
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.