11 2019 档案

摘要:Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of t 阅读全文
posted @ 2019-11-13 09:08 CNoodle 阅读(482) 评论(0) 推荐(0)
摘要:Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] 阅读全文
posted @ 2019-11-11 13:23 CNoodle 阅读(488) 评论(0) 推荐(0)
摘要:You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on the following form 阅读全文
posted @ 2019-11-10 14:46 CNoodle 阅读(445) 评论(0) 推荐(0)
摘要:Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Example 1: Input: head = [1,2,2,1] Output: true Example 阅读全文
posted @ 2019-11-10 09:28 CNoodle 阅读(217) 评论(0) 推荐(0)
摘要:You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing toge 阅读全文
posted @ 2019-11-10 08:01 CNoodle 阅读(646) 评论(0) 推荐(0)
摘要:Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersec 阅读全文
posted @ 2019-11-10 07:54 CNoodle 阅读(222) 评论(0) 推荐(0)
摘要:Given the head of a linked list, return the list after sorting it in ascending order. Follow up: Can you sort the linked list in O(n logn) time and O( 阅读全文
posted @ 2019-11-10 05:54 CNoodle 阅读(567) 评论(0) 推荐(0)
摘要:Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there 阅读全文
posted @ 2019-11-10 05:24 CNoodle 阅读(484) 评论(0) 推荐(0)
摘要:Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the 阅读全文
posted @ 2019-11-10 04:16 CNoodle 阅读(433) 评论(0) 推荐(0)
摘要:Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the 阅读全文
posted @ 2019-11-08 03:24 CNoodle 阅读(454) 评论(0) 推荐(0)
摘要:Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. Example 阅读全文
posted @ 2019-11-08 01:40 CNoodle 阅读(441) 评论(0) 推荐(0)
摘要:Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3,4,5], n = 2 Output: 阅读全文
posted @ 2019-11-08 01:20 CNoodle 阅读(430) 评论(0) 推荐(0)
摘要:Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should p 阅读全文
posted @ 2019-11-06 00:56 CNoodle 阅读(430) 评论(0) 推荐(0)
摘要:Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] 阅读全文
posted @ 2019-11-05 15:46 CNoodle 阅读(184) 评论(0) 推荐(0)
摘要:Given the head of a linked list, rotate the list to the right by k places. Example 1: Input: head = [1,2,3,4,5], k = 2 Output: [4,5,1,2,3] Example 2: 阅读全文
posted @ 2019-11-05 15:25 CNoodle 阅读(452) 评论(0) 推荐(0)
摘要:Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordere 阅读全文
posted @ 2019-11-05 03:34 CNoodle 阅读(159) 评论(0) 推荐(0)
摘要:Write an efficient algorithm that searches for a target value in an m x n integer matrix. The matrix has the following properties: Integers in each ro 阅读全文
posted @ 2019-11-05 02:23 CNoodle 阅读(209) 评论(0) 推荐(0)
摘要:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2019-11-05 02:08 CNoodle 阅读(484) 评论(0) 推荐(0)
摘要:There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values). Before being passed to your function, nums is ro 阅读全文
posted @ 2019-11-05 00:03 CNoodle 阅读(438) 评论(0) 推荐(0)
摘要:There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is rotated at an unknown 阅读全文
posted @ 2019-11-04 14:26 CNoodle 阅读(474) 评论(0) 推荐(0)
摘要:Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,4,4,5,6,7] might become: [ 阅读全文
posted @ 2019-11-04 13:39 CNoodle 阅读(382) 评论(0) 推荐(0)
摘要:Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: [ 阅读全文
posted @ 2019-11-04 13:31 CNoodle 阅读(470) 评论(0) 推荐(0)
摘要:A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its in 阅读全文
posted @ 2019-11-04 12:41 CNoodle 阅读(337) 评论(0) 推荐(0)
摘要:Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found 阅读全文
posted @ 2019-11-04 12:18 CNoodle 阅读(537) 评论(0) 推荐(0)
摘要:You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, hei 阅读全文
posted @ 2019-11-02 12:41 CNoodle 阅读(492) 评论(0) 推荐(0)
摘要:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2019-11-01 14:07 CNoodle 阅读(164) 评论(0) 推荐(0)
摘要:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is 阅读全文
posted @ 2019-11-01 13:50 CNoodle 阅读(611) 评论(0) 推荐(0)
摘要:Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest 阅读全文
posted @ 2019-11-01 12:16 CNoodle 阅读(279) 评论(0) 推荐(0)
摘要:You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval 阅读全文
posted @ 2019-11-01 11:18 CNoodle 阅读(498) 评论(0) 推荐(0)
摘要:Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals 阅读全文
posted @ 2019-11-01 02:25 CNoodle 阅读(522) 评论(0) 推荐(0)
摘要:Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. Exampl 阅读全文
posted @ 2019-11-01 01:35 CNoodle 阅读(678) 评论(0) 推荐(0)