![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode (Java)
Java
KAKUNIN_
伤痛之末,涅槃之始
展开
-
9. 回文数
转化为字符串处理class Solution { public boolean isPalindrome(int x) { String num = Integer.toString(x); int len = num.length(); for (int i = 0; i < len/2; i++) { if (num.charAt(i) != num.charAt(len-i-1)) .原创 2022-05-06 10:54:53 · 218 阅读 · 0 评论 -
1.两数之和
暴力求解class Solution { public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length-1; i++) { for (int j = i+1; j < nums.length; j++) { if (nums[i] + nums[j] == target) { re.原创 2022-05-05 16:59:32 · 180 阅读 · 0 评论