随笔分类 -  LeetCode

上一页 1 ··· 3 4 5 6 7

【转载】LeetCode 题目总结/分类
摘要:引自:http://www.douban.com/note/330562764/注:此分类仅供大概参考,没有精雕细琢。有不同意见欢迎评论~利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.l... 阅读全文

posted @ 2014-10-24 17:46 Yu's Garden 阅读(2163) 评论(1) 推荐(2) 编辑

LeetCode: Sort Colors 解题报告
摘要:Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the ... 阅读全文

posted @ 2014-10-24 16:39 Yu's Garden 阅读(932) 评论(0) 推荐(0) 编辑

LeetCode: Search for a Range 解题报告
摘要:Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ... 阅读全文

posted @ 2014-10-24 12:40 Yu's Garden 阅读(2183) 评论(0) 推荐(1) 编辑

LeetCode: Spiral Matrix II 解题报告-三种方法解决旋转矩阵问题
摘要:Spiral Matrix IIGiven an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should retu... 阅读全文

posted @ 2014-10-24 11:06 Yu's Garden 阅读(917) 评论(0) 推荐(0) 编辑

LeetCode: Set Matrix Zeroes 解题报告
摘要:Set Matrix ZeroesGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did yo... 阅读全文

posted @ 2014-10-24 09:44 Yu's Garden 阅读(565) 评论(0) 推荐(0) 编辑

LeetCode: Spiral Matrix 解题报告
摘要:Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following m... 阅读全文

posted @ 2014-10-23 18:39 Yu's Garden 阅读(1744) 评论(0) 推荐(1) 编辑

LeetCode: Word Break II 解题报告
摘要:Word Break IIGiven a string s and a dictionary of words dict, add spaces in s toconstruct a sentence where each word is a valid dictionaryword.Return ... 阅读全文

posted @ 2014-10-23 04:40 Yu's Garden 阅读(9650) 评论(1) 推荐(0) 编辑

LeetCode: Clone Graph 解题报告
摘要:Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes ar... 阅读全文

posted @ 2014-10-22 20:48 Yu's Garden 阅读(942) 评论(0) 推荐(0) 编辑

LeetCode: Maximum Product Subarray 解题报告
摘要:Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given... 阅读全文

posted @ 2014-10-22 18:06 Yu's Garden 阅读(1148) 评论(0) 推荐(1) 编辑

LeetCode: Populating Next Right Pointers in Each Node II 解题报告
摘要:Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文

posted @ 2014-10-21 19:20 Yu's Garden 阅读(2717) 评论(0) 推荐(0) 编辑

LeetCode: Populating Next Right Pointers in Each Node 解题报告
摘要:Populating Next Right Pointers in Each Node TotalGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next... 阅读全文

posted @ 2014-10-21 19:18 Yu's Garden 阅读(1969) 评论(0) 推荐(0) 编辑

LeetCode: Word Search 解题报告
摘要:Word SearchGiven 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, wh... 阅读全文

posted @ 2014-10-21 15:10 Yu's Garden 阅读(3683) 评论(1) 推荐(0) 编辑

LeetCode: String to Integer (atoi) 解题报告
摘要:String to Integer (atoi) Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, ... 阅读全文

posted @ 2014-10-21 11:32 Yu's Garden 阅读(717) 评论(0) 推荐(0) 编辑

LeetCode: Jump Game Total 解题报告
摘要:Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo... 阅读全文

posted @ 2014-10-21 11:08 Yu's Garden 阅读(2131) 评论(0) 推荐(0) 编辑

LeetCode: First Missing Positive 解题报告
摘要:Q:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0]return 3,and [3,4,-1,1]return 2.Your algorithm sho... 阅读全文

posted @ 2014-10-20 18:45 Yu's Garden 阅读(660) 评论(5) 推荐(0) 编辑

LeetCode: Add Two Numbers 解题报告
摘要:Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co... 阅读全文

posted @ 2014-10-20 17:52 Yu's Garden 阅读(498) 评论(0) 推荐(0) 编辑

LeetCode: Palindrome Partitioning 解题报告
摘要:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,... 阅读全文

posted @ 2014-10-20 16:51 Yu's Garden 阅读(1820) 评论(2) 推荐(0) 编辑

LeetCode: Reverse Nodes in k-Group 解题报告
摘要:Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a... 阅读全文

posted @ 2014-10-20 13:50 Yu's Garden 阅读(544) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7

导航