Aktiver Arbeitgeber
Write a function to determain if a string is Palindrome?
Anonym
use two pointer left and right in a while loop. check whether char at left equals to right. if yes, left++ and right--, if not, return false.
public static boolean isPalindrome(String text, int start, int end){ if (text == null) { return false; } if (start >= end) { return true; } if (text.charAt(start) != text.charAt(end)) { return false; } return isPalindrome(text,start+1,end-1); }
Verschaffe dir einen Vorsprung bei Chancen und Insider-Tipps, indem du deinem Traumunternehmen folgst.
Erhalte personalisierte Jobempfehlungen und Updates, indem du Suchanfragen startest.