摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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: 阅读全文
摘要:
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 阅读全文
摘要:
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] 阅读全文
摘要:
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: 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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: [ 阅读全文
摘要:
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: [ 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文