
Scan a single command-line string and surface the longest contiguous slice that reads the same in both directions.
./longest_palindrome "racecar"Expected result
racecarFor your own tracking. Tests grade your code.
./longest_palindrome "abcdcbxyz"Expected result
bcdcb./longest_palindrome "shipitlevell"Expected result
level./longest_palindromeExpected result
wrong number of argumentsExpected files
longest_palindrome.cAllowed functions
write
v0.40: Create exercises. Challenge the community.
Meet Studio →Scan a single command-line string and surface the longest contiguous slice that reads the same in both directions.
./longest_palindrome "racecar"Expected result
racecarFor your own tracking. Tests grade your code.
./longest_palindrome "abcdcbxyz"Expected result
bcdcb./longest_palindrome "shipitlevell"Expected result
level./longest_palindromeExpected result
wrong number of argumentsExpected files
longest_palindrome.cAllowed functions
write
Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.