于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;}}簡(jiǎn)單題針對(duì)本題采用了轉(zhuǎn)字符串后逐個(gè)比較字符串字符的方法進(jìn)行作答