Sollicitatievraag bij Arista Networks

implement a function that determines a string is whether a palindrome or not

Antwoorden op sollicitatievragen

Anoniem

24 okt 2017

I wrote a recursive function that gets a string, starting point and ending point.

Anoniem

12 dec 2017

#include #include main() { char str[]="abcbba"; int len=0; len=strlen(str); for(int i=0;i<=len/2;i++) { if(str[i] != str[(len-i)-1]) { printf("The string is not a palindrome\n"); return; } } printf("The string is a palindrome\n"); }

Anoniem

12 dec 2017

#include #include main() { char str[]="abcbba"; int len=0; len=strlen(str); for(int i=0;i<=len/2;i++) { if(str[i] != str[(len-i)-1]) { printf("The string is not a palindrome\n"); return; } } printf("The string is a palindrome\n"); }