Pregunta de entrevista de 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.)

Respuestas de entrevistas

Anónimo

15 ene 2014

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

Anónimo

1 dic 2017

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

Anónimo

1 dic 2017

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

Anónimo

1 dic 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;