- 博客(65)
- 收藏
- 关注
原创 [Leetcode]Bulb Switcher
Bulb Switcher Total Accepted: 970 Total Submissions: 2597 Difficulty: MediumThere are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the thi
2015-12-20 21:04:49
1392
翻译 Absloute path vs relative path in Linux/Unix(Linux/Unix中的绝对路径vs相对路径)
Linux/Unix中的绝对路径vs相对路径什么是路径在一个操作系统的文件系统中,路径是到达一个文件或一个目录的一条唯一的路线。到达一个文件的路径是由‘/’以及字母-数字组成的。 什么是绝对路径绝对路径被定义为从根目录开始的一条通向文件或目录的路径。换句话说,绝对路径即从实际文件系统的/目录开始的一条完整路径。(译者注:绝对路径是唯一的)关于绝对路径的栗子/var/ftp/pub/etc/sam
2015-12-19 00:14:27
16533
15
原创 [Leetcode]House Robber II
House Robber II Total Accepted: 18212 Total Submissions: 63419 Difficulty: MediumNote: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new
2015-12-18 20:43:17
481
原创 [Leetcode]House Robber
House Robber Total Accepted: 45703 Total Submissions: 142461 Difficulty: EasyYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the
2015-12-18 19:51:35
389
原创 [Leetcode]Populating Next Right Pointers in Each Node
Populating Next Right Pointers in Each Node My Submissions Question Total Accepted: 72104 Total Submissions: 198545 Difficulty: Medium Given a binary treestruct TreeLinkNode { TreeLinkNode *left;
2015-12-15 10:25:20
299
原创 [Leetcode]Range Sum Query
Range Sum Query - Immutable Total Accepted: 9791 Total Submissions: 40927 Difficulty: EasyGiven an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:G
2015-12-14 21:04:22
327
原创 [Leetcode]Bulls and Cows
Bulls and Cows Total Accepted: 10932 Total Submissions: 42057 Difficulty: EasyYou are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess w
2015-12-14 20:55:36
327
原创 [Leetcode]Rectangle Area
Rectangle Area Total Accepted: 24959 Total Submissions: 89043 Difficulty: EasyFind the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corne
2015-12-14 20:16:18
306
原创 [Leetcode]Reverse Words in a String
Reverse Words in a String My Submissions Question Total Accepted: 84277 Total Submissions: 546781 Difficulty: Medium Given an input string, reverse the string word by word.For example, Given s = “th
2015-12-13 14:37:35
389
原创 [Leetcode]Decode Ways
Decode Ways Total Accepted: 55623 Total Submissions: 331926 Difficulty: MediumA message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -
2015-12-12 22:21:15
341
原创 [Leetcode]Range Sum Query 2D - Immutable
Range Sum Query 2D - Immutable Total Accepted: 4160 Total Submissions: 20469 Difficulty: MediumGiven a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left cor
2015-12-11 20:58:41
367
原创 [Leetcode]Course Schedule II
Course Schedule II My Submissions Question Total Accepted: 16442 Total Submissions: 80267 Difficulty: Medium There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may
2015-12-11 17:20:22
370
原创 [Leetcode]Word Search
Word Search Total Accepted: 58219 Total Submissions: 270800 Difficulty: MediumGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially
2015-12-10 16:14:11
309
原创 [Leetcode]Longest Palindromic Substring
Longest Palindromic Substring Total Accepted: 82394 Total Submissions: 381112 Difficulty: MediumGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of
2015-12-10 15:16:56
297
原创 [Leetcode]Rotate List
Rotate List Total Accepted: 55147 Total Submissions: 249704 Difficulty: MediumGiven a list, rotate the list to the right by k places, where k is non-negative.For example: Given 1->2->3->4->5->NULL an
2015-12-08 19:19:32
346
原创 [Leetcode]Evaluate Reverse Polish Notation
Evaluate Reverse Polish Notation Total Accepted: 55506 Total Submissions: 249113 Difficulty: MediumEvaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *
2015-12-06 16:46:55
272
原创 [Leetcode]Sqrt(x)
Sqrt(x) Total Accepted: 74812 Total Submissions: 310770 Difficulty: MediumImplement int sqrt(int x).Compute and return the square root of x.Subscribe to see which companies asked this question题目很简单,弄清
2015-12-02 19:31:22
388
原创 [Leetcode]Remove Duplicates from Sorted List II
Remove Duplicates from Sorted List II Total Accepted: 58686 Total Submissions: 228299 Difficulty: MediumGiven a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct
2015-11-30 21:44:26
349
原创 [Leetcode]Binary Tree Zigzag Level Order Traversal
Binary Tree Zigzag Level Order Traversal My Submissions Question Total Accepted: 47731 Total Submissions: 176275 Difficulty: Medium Given a binary tree, return the zigzag level order traversal of its
2015-11-27 13:25:56
435
原创 [Leetcode]3Sum Closest
3Sum Closest My Submissions Question Total Accepted: 58639 Total Submissions: 212334 Difficulty: Medium Given an array S of n integers, find three integers in S such that the sum is closest to a give
2015-11-26 12:14:42
290
原创 [Leetcode]Search for a Range
Search for a Range My Submissions Question Total Accepted: 64904 Total Submissions: 232560 Difficulty: Medium Given a sorted array of integers, find the starting and ending position of a given target
2015-11-25 21:46:53
268
原创 [Leetcode]Construct Binary Tree from Inorder and Postorder Traversal
Construct Binary Tree from Inorder and Postorder Traversal My Submissions Question Total Accepted: 44071 Total Submissions: 159513 Difficulty: Medium Given inorder and postorder traversal of a tree,
2015-11-23 20:49:18
315
原创 [Leetcode]Perfect Squares(DP and Math Solution)
**Perfect Squares My Submissions Question Total Accepted: 16355 Total Submissions: 55778 Difficulty: Medium Given a positive integer n, find the least number of perfect square numbers (for example, 1
2015-11-21 10:34:16
449
原创 [Leetcode]Unique Path II
Unique Paths II My Submissions Question Total Accepted: 51318 Total Submissions: 180828 Difficulty: Medium Follow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many
2015-11-21 00:08:38
305
原创 [Leetcode]Subsets
Subsets My Submissions Question Total Accepted: 72388 Total Submissions: 247343 Difficulty: Medium Given a set of distinct integers, nums, return all possible subsets.Note: Elements in a subset must
2015-11-20 16:37:13
326
原创 [Leetcode]Flatten Binary Tree to Linked List~
Flatten Binary Tree to Linked List My Submissions Question Total Accepted: 66064 Total Submissions: 223714 Difficulty: Medium Given a binary tree, flatten it to a linked list in-place.For example, G
2015-11-20 16:01:10
347
原创 [Leetcode]Binary Tree Right Side View(TAT)
Binary Tree Right Side View My Submissions Question Total Accepted: 26870 Total Submissions: 87779 Difficulty: Medium Given a binary tree, imagine yourself standing on the right side of it, return th
2015-11-19 18:59:47
299
原创 [Leetcode]Search a 2D Matrix II
Search a 2D Matrix II My Submissions Question Total Accepted: 19946 Total Submissions: 64757 Difficulty: Medium Write an efficient algorithm that searches for a value in an m x n matrix. This matrix
2015-11-19 14:36:08
278
原创 [Leetcode]Search in Rotated Sorted Array
Search in Rotated Sorted Array My Submissions Question Total Accepted: 78974 Total Submissions: 271221 Difficulty: Hard Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.
2015-11-17 13:53:52
301
原创 [Leetcode]Longest Increasing Subsequence
Longest Increasing Subsequence My Submissions Question Total Accepted: 6296 Total Submissions: 20294 Difficulty: Medium Given an unsorted array of integers, find the length of longest increasing subs
2015-11-17 12:09:12
272
原创 [Leetcode]Combination Sum III
LeetCode OJ LeetCode Premium Subscription Problems Pick One! Courses Discuss Book WooStam Combination Sum III My Submissions Question Total Accepted: 17981 Total Submissions: 56703 Difficult
2015-11-16 21:45:29
421
原创 [Leetcode]Spiral MatrixII
Spiral Matrix II My Submissions Question Total Accepted: 41348 Total Submissions: 125636 Difficulty: Medium Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral or
2015-11-16 19:56:45
271
原创 [Leetcode]Spiral Matrix
Spiral Matrix My Submissions Question Total Accepted: 45054 Total Submissions: 212085 Difficulty: Medium Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spi
2015-11-16 13:44:52
298
原创 [Leecode]Linked List CycleII
Linked List Cycle II My Submissions Question Total Accepted: 59621 Total Submissions: 189735 Difficulty: Medium Given a linked list, return the node where the cycle begins. If there is no cycle, retu
2015-11-15 18:52:36
320
原创 [LeetCode] H-Index
H-Index Total Accepted: 15872 Total Submissions: 60068 Difficulty: MediumGiven an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the research
2015-11-11 10:38:19
332
原创 [LeetCode] Search a 2D Matrix
class Solution {public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int m = matrix.size(); int n = matrix[0].size(); int len = m * n; int l = 0;
2015-11-09 21:08:11
249
原创 [Leetcode] Find Minimum in Rotated Sorted Array
Find Minimum in Rotated Sorted Array My Submissions Question Total Accepted: 67103 Total Submissions: 195803 Difficulty: Medium Suppose a sorted array is rotated at some pivot unknown to you beforeha
2015-11-05 13:43:27
256
原创 [Leetcode]Swap Nodes in Pairs
Swap Nodes in Pairs My Submissions Question Total Accepted: 69767 Total Submissions: 210542 Difficulty: Medium Given a linked list, swap every two adjacent nodes and return its head.For example, Giv
2015-11-05 13:16:11
186
原创 [leetcode]Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search Tree My Submissions Question Total Accepted: 57734 Total Submissions: 165322 Difficulty: Medium Given an array where elements are sorted in ascending order, conv
2015-11-02 23:09:27
264
原创 [leetcode]Product of Array Except Self
Product of Array Except Self My Submissions Question Total Accepted: 21825 Total Submissions: 57345 Difficulty: Medium Given an array of n integers where n > 1, nums, return an array output such that
2015-11-02 22:16:27
294
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人