Code Coach it’s a sign fails test case 5 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Code Coach it’s a sign fails test case 5

My code passes every test i throw at it but fails the hidden test case 5. After re-reading the instructions I noticed that the program supposedly also needs to test for phrases in addition to words. I then modified my scanf() to receive strings that include spaces. The rest of my code should have no problem processing the longer strings. Instead of solving the issue I then failed hidden test case 3 as well. I’m stumped. Any insight is appreciated. https://code.sololearn.com/cOa3RbaZ42Wy/?ref=app

19th Jun 2020, 12:38 PM
Ian Andersen
Ian Andersen - avatar
4 Answers
+ 2
Addendum: I just caught the fact that single character words like I and a are not palindromes so i modified my code to exclude them. The code still fails test case 5.
19th Jun 2020, 12:43 PM
Ian Andersen
Ian Andersen - avatar
+ 2
Wait... && l < 1?
19th Jun 2020, 1:50 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
oops typo in my posted code. my solution reads && l > 1. good catch. That was my approach to remove “I” and “A” from the palindrome count. no effect on the outcome though.
19th Jun 2020, 2:14 PM
Ian Andersen
Ian Andersen - avatar
+ 2
I was able to accept strings with spaces on multiple lines utilizing %[^\n]%*c in the scanf. this resolved test case 3 failing but im still stumped on test case 5.
21st Jun 2020, 1:43 PM
Ian Andersen
Ian Andersen - avatar