上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Example 2: 阅读全文
posted @ 2019-02-21 19:58 TobicYAL 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 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]). Y 阅读全文
posted @ 2019-02-19 09:28 TobicYAL 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-02-15 17:49 TobicYAL 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 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 "adjac 阅读全文
posted @ 2019-02-15 17:20 TobicYAL 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl 阅读全文
posted @ 2019-02-15 16:13 TobicYAL 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: 题意 在1到n中取k个数的所有情况 题解 1 class Solution { 2 public: 3 阅读全文
posted @ 2019-02-15 15:45 TobicYAL 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 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). Example: Note: If there i 阅读全文
posted @ 2019-02-15 15:16 TobicYAL 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 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 or 阅读全文
posted @ 2019-02-13 20:41 TobicYAL 阅读(131) 评论(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-02-13 20:13 TobicYAL 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Example 1: Example 2: Follow up: A straight forward solu 阅读全文
posted @ 2019-02-13 20:04 TobicYAL 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitt 阅读全文
posted @ 2019-02-13 19:40 TobicYAL 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path. In a UNIX-style file system, a perio 阅读全文
posted @ 2019-02-13 18:23 TobicYAL 阅读(172) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2019-02-12 22:11 TobicYAL 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in 阅读全文
posted @ 2019-02-12 22:04 TobicYAL 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Given an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justif 阅读全文
posted @ 2019-02-12 21:46 TobicYAL 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Example 1 阅读全文
posted @ 2019-02-12 20:02 TobicYAL 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d 阅读全文
posted @ 2019-02-12 17:39 TobicYAL 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2019-02-11 11:14 TobicYAL 阅读(177) 评论(0) 推荐(0) 编辑
摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2019-02-11 10:43 TobicYAL 阅读(169) 评论(0) 推荐(0) 编辑
摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2019-02-09 16:31 TobicYAL 阅读(141) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页