LeetCoder
宇宙无敌帅超人
这个作者很懒,什么都没留下…
展开
-
Leetcode刷题记录:[92] 反转链表 II
BaseCode:class Solution { public ListNode reverseBetween(ListNode head, int left, int right) { if (head == null || left == right) { return head; } ListNode cur = head; ListNode newHead = new ListNode(0);原创 2022-02-18 16:55:08 · 296 阅读 · 0 评论 -
LeetCoder(2)
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...原创 2018-07-11 20:25:29 · 2957 阅读 · 0 评论 -
Array(35.Search Insert Position)
解法1:class Solution { public int searchInsert(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { if (target == nums[i]){ return i; ...原创 2018-11-15 23:34:01 · 2951 阅读 · 0 评论 -
Arrays(66. Plus One)
解法:class Solution { public static int[] plusOne(int[] digits) { int index = -1; for(int i=digits.length - 1;i>=0;i--){ //for循环从数组最后一位开始判断该位是否=9 if(digits[i] < ...原创 2018-11-15 23:43:22 · 2953 阅读 · 0 评论