随笔分类 -  LeetCode

上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 61 下一页
摘要:You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum ju 阅读全文
posted @ 2015-03-27 13:17 Grandyang 阅读(31118) 评论(15) 推荐(2) 编辑
摘要:Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals 阅读全文
posted @ 2015-03-27 02:53 Grandyang 阅读(37217) 评论(21) 推荐(1) 编辑
摘要: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 @ 2015-03-26 00:59 Grandyang 阅读(22516) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. Example 1: Input: n = 3 Output: [[1,2,3],[8,9, 阅读全文
posted @ 2015-03-24 14:54 Grandyang 阅读(11540) 评论(17) 推荐(0) 编辑
摘要:Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,2,3,6,9,8,7, 阅读全文
posted @ 2015-03-24 14:22 Grandyang 阅读(25871) 评论(9) 推荐(1) 编辑
摘要:Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. Example 1: Input: nums = [1, 阅读全文
posted @ 2015-03-23 14:57 Grandyang 阅读(30045) 评论(10) 推荐(2) 编辑
摘要:Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2, 阅读全文
posted @ 2015-03-23 08:29 Grandyang 阅读(53905) 评论(1) 推荐(0) 编辑
摘要:The set [1, 2, 3, ..., n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following s 阅读全文
posted @ 2015-03-23 01:44 Grandyang 阅读(21959) 评论(6) 推荐(2) 编辑
摘要: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 @ 2015-03-21 13:49 Grandyang 阅读(14753) 评论(5) 推荐(0) 编辑
摘要:You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to th 阅读全文
posted @ 2015-03-20 15:13 Grandyang 阅读(15968) 评论(7) 推荐(1) 编辑
摘要:There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-rig 阅读全文
posted @ 2015-03-20 14:30 Grandyang 阅读(22665) 评论(7) 推荐(2) 编辑
摘要: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 @ 2015-03-20 11:50 Grandyang 阅读(17545) 评论(4) 推荐(3) 编辑
摘要:Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right 阅读全文
posted @ 2015-03-19 14:39 Grandyang 阅读(15733) 评论(3) 推荐(3) 编辑
摘要:Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simpl 阅读全文
posted @ 2015-03-18 14:39 Grandyang 阅读(18298) 评论(8) 推荐(2) 编辑
摘要:Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. 阅读全文
posted @ 2015-03-18 10:10 Grandyang 阅读(30400) 评论(15) 推荐(2) 编辑
摘要:Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations 阅读全文
posted @ 2015-03-17 13:00 Grandyang 阅读(29989) 评论(13) 推荐(2) 编辑
摘要:Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. You must do it in place. Example 1: Input: matrix = [[ 阅读全文
posted @ 2015-03-16 13:18 Grandyang 阅读(17822) 评论(7) 推荐(0) 编辑
摘要:Given an array nums 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 阅读全文
posted @ 2015-03-16 10:50 Grandyang 阅读(24426) 评论(6) 推荐(2) 编辑
摘要:Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicat 阅读全文
posted @ 2015-03-16 07:13 Grandyang 阅读(39558) 评论(19) 推荐(0) 编辑
摘要:Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n]. You may return the answer in any order. Exampl 阅读全文
posted @ 2015-03-12 15:23 Grandyang 阅读(25085) 评论(8) 推荐(1) 编辑

上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 61 下一页
Fork me on GitHub