Pergunta de entrevista da empresa Meta

Check if two strings are Palindrome

Respostas da entrevista

Sigiloso

12 de fev. de 2013

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

Sigiloso

17 de fev. de 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; }

Sigiloso

3 de ago. de 2013

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