+ 2

Problem in code coach

Name of codecoach problem: Longest Common Substring My code is showing the correct output but still the test case is showing it is wrong Can someone help me find the bug in my code or is the test case given wrong My code: https://code.sololearn.com/ctDUFR5yC64n/?ref=app

10th Jan 2023, 4:44 PM
Shaurya Agarwal
Shaurya Agarwal - avatar
11 Answers
+ 2
10th Jan 2023, 7:01 PM
SoloProg
SoloProg - avatar
+ 2
Shaurya Agarwal In code coaches, check expected output with your output. There should match exactly.. Instead of using words= input("Enter string: ").split(" ") Try : words= input().split()
10th Jan 2023, 5:00 PM
Jayakrishna 🇮🇳
+ 2
Shaurya Agarwal CDAQ is the correct answer for test case. Observe again, all string contains CDAQ. So try again to find out mistake in your code. print s instead of ls..
11th Jan 2023, 9:36 AM
Jayakrishna 🇮🇳
+ 1
Lamron no problem, thank you for considering my question
10th Jan 2023, 4:51 PM
Shaurya Agarwal
Shaurya Agarwal - avatar
+ 1
Jayakrishna🇮🇳 I have tried that but still test case #2 is not matching
10th Jan 2023, 5:11 PM
Shaurya Agarwal
Shaurya Agarwal - avatar
+ 1
Thank you all for your valuable time and help, my problem is solved
11th Jan 2023, 4:07 PM
Shaurya Agarwal
Shaurya Agarwal - avatar
+ 1
darren slinger You can ask in new thread, instead of others and unrelated to OP question.. Or use search option in q/a.. println() method appends a new line '\n' character after printing text. So pointer goes to next line. But print don't add newline.
12th Jan 2023, 10:43 AM
Jayakrishna 🇮🇳
0
What is the name of the code coach you're doing?
10th Jan 2023, 4:46 PM
Lamron
Lamron - avatar
0
Longest Common Substring
10th Jan 2023, 4:47 PM
Shaurya Agarwal
Shaurya Agarwal - avatar
0
Unfortunately I do not know how to do it yet, so you will have to wait for someone who's more experienced that can help 🙂
10th Jan 2023, 4:50 PM
Lamron
Lamron - avatar
0
Im new here and im busy with the java assessments, completed the 1st category, yet im still not sure what the difference between print() and printIn() is
12th Jan 2023, 10:33 AM
darren slinger
darren slinger - avatar