Sollicitatievraag bij Susquehanna International Group

Write a function that is passed a string and determines whether or not the string is a palindrome. (They had me write on the whiteboard in front of them.)

Antwoorden op sollicitatievragen

Anoniem

15 jan 2014

I used for-loops and character arrays and got the question right.

Anoniem

1 dec 2017

I think the double index way is pretty neat. for(int i=0,j=n-1;i

Anoniem

1 dec 2017

I think the double index way is pretty neat. for(int i=0,j=n-1;i

Anoniem

1 dec 2017

I think the double index way is pretty neat. for(int i=0,j=n-1;i < j;i++,j--) if(s[i]!=s[j]) return false; return true;