Pergunta de entrevista da empresa Meta

Given a string, return true if it's a palindrome. Only alphanumeric characters considered. Do this in one pass through the string.

Resposta da entrevista

Sigiloso

3 de mar. de 2013

boolean isPalindrome(String input) { String copy = input; for(int i = 0, j= input.length() - 1; j >= 0; --j) if (input.charAt(i++) != copy.charAt(j)) return false; return true; }