Pergunta de entrevista da empresa Jet

Write an algorithm to determine if a string is a palindrome.

Respostas da entrevista

Sigiloso

6 de ago. de 2015

With a good algorithm.

Sigiloso

19 de fev. de 2016

string pal = "abcba"; bool isPalindrome = true; int length = pal.Length; for (int i = 0; i < (int)length / 2; i++) { if (pal[i] != pal[length - i - 1]) { isPalindrome = false; break; } }