Question d’entretien chez Meta

Check if two strings are Palindrome

Réponses aux questions d'entretien

Utilisateur anonyme

12 févr. 2013

non-recursive: bool pali(string a, string b){ if(a.size() != b.size()) return false; for (int i = 0; i

Utilisateur anonyme

17 févr. 2013

int palindrome(string a) { assert(a.length());//Abort is string empty int val = 1;//default value is true for(int i = 0; i < a.length(); i++)//Can actually restrict i:0-length/2 val *= (a[i]==a[a.length()-1-i]); return val; }

Utilisateur anonyme

3 août 2013

Python implimentation string==string[::-1] Of course your interviewer will ask you to elaborate.