/images/logo.jpg

源码赏析

LeetCode002 Add Two Numbers

读题 有两个链表,链表的每个节点都保存一个数字,联表的头部为个位,对两个链表进行相加,得出一个新的链表,这种方式相较于直接 int 类型相加,没有最大

LeetCode001 Two Sum

个人解题思路 双重for循环暴力解题,直接上代码。 1 2 3 4 5 6 7 8 9 10 11 12 13 class Solution { public int[] twoSum(int[] nums, int target) { int len = nums.length; for (int i = 0; i < len; i++) { for (int j = i + 1; j <