+ 1

What does this task mean?

When i challenge the "Longest Common Substring" in codecoach (https://www.sololearn.com/coach/95?ref=app ), i found some confusing task in the output format that says, "If there are multiple longest common substrings, output the smallest one in alphabetical order." Can anyone explain it to me what should this task do? Should i arrange the common substring alphabetically or chose the shortest one to output? (If the input have 2 or more common substrings) Btw i create the code like this: https://sololearn.com/compiler-playground/cQrA8nH0F8yG/?ref=app The code works if the input has a single common substring.

5th Dec 2024, 3:48 AM
Celvien Kurniawan
Celvien Kurniawan - avatar
3 Antworten
+ 8
Celvien Kurniawan it's asking you to do both to sort it in alphabetical order then choose the shortest substring
5th Dec 2024, 4:04 AM
Aysha
Aysha - avatar
+ 3
Oh i see. Thanks.
5th Dec 2024, 4:05 AM
Celvien Kurniawan
Celvien Kurniawan - avatar
+ 3
The description of that task has always been confusing. It also confused me when I struggled with it long time ago, but the output should only be "the LONGEST common substring", and nothing else.
5th Dec 2024, 9:18 AM
Jan
Jan - avatar