于LeetCode第9題的題解)
**關(guān)于LeetCode第9題的題解**classSolution{publicbooleanisPalindrome(intx){Integeryx;Stringsy.toString();intlengths.length();Booleanflagtrue;for(inti0;ilength;i){if(s.charAt(i)!s.charAt(length-i-1)){flagfalse;break;}}returnflag;}}簡單題針對本題采用了轉(zhuǎn)字符串后逐個比較字符串字符的方法進行作答