Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
(移除链表中的重复元素(所有元素只出现一次))
Given a sorted linked list, delete all duplicates such that each element appear only once.
(移除链表中的重复元素(所有元素只出现一次))
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
(移除链表中的重复元素(删除出现2次以上的元素))
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). You are given a target value to search. If found in the array return true, otherwise return false.
(在时间复杂度为O(log n)的前提下在经旋转的有序数组中检索(数组中含有重复元素))
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
(删除数组中超过两次的元素,in-place, 限制空间复杂度)
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
(矩阵中进行词语搜索)
Given a set of distinct integers, nums, return all possible subsets (the power set).
(列举所有子集)
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
(列举 C_n^k 的所有组合)
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
(包含字符串的最小窗口)
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
(in-place 分组排序)
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 from left to right. The first integer of each row is greater than the last integer of the previous row.
(查找数值是否在有序矩阵中)