- 博客(16)
- 资源 (1)
- 收藏
- 关注
原创 Leetcode NO.71 Simplify Path
本题题目于要求如下: Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" Corner Cases: Did you consider the
2015-05-27 05:34:22 354
原创 Leetcode NO.216 Combination Sum III
本题题目要求如下: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Ensure
2015-05-27 04:28:23 379
原创 Leetcode NO.87 Scramble String
本题题目要求如下: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great
2015-05-23 04:40:21 412
原创 Leetcode NO.213 House Robber II
本次的题目要求如下: Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much atte
2015-05-21 07:34:08 468
原创 Leetcode NO.187 Repeated DNA Sequences
本题题目要求如下: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within
2015-05-20 03:10:47 395
原创 Leetcode NO.98 Validate Binary Search Tree
本题题目要求如此下: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than t
2015-05-19 02:54:56 366
原创 Leetcode NO.209 Minimum Size Subarray Sum
本题题目要求如下: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead. For example, given
2015-05-16 02:04:12 300
原创 Leetcode NO.152 Maximum Product Subarray
本题题目要求如下: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] h
2015-05-08 07:09:39 351
原创 Leetcode NO.199 Binary Tree Right Side View
本题题目要求如下: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example: Given the following binar
2015-05-08 04:43:21 387
原创 Leetcode NO.200 Number of Islands
本题要求如下: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.
2015-05-07 07:19:04 382
原创 Leetcode NO.204 Count Primes
本题题目要求如下: Description: Count the number of prime numbers less than a non-negative number, n 就是数prime的数量。。。。我的算法肯定不算好的,看运行时间算是比较长的。但是也算是一种思路吧。。尽管确实是最傻的。。 比如1,2,3,4,5.。。25这25个数。。 从2开始,所有2的倍数逗
2015-05-07 06:17:43 408
原创 Leetcode NO.205 Isomorphic Strings
本题题目要求如下: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be
2015-05-07 01:09:16 402
原创 Leetcode NO.203 Remove Linked List Elements
本题题目要求如下: Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 --> 4 --> 5 其实就是链表的基本操作
2015-05-06 07:30:13 271
原创 Leetcode NO.198 House Robber
本题题目要求如下: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that
2015-05-06 06:50:23 768
原创 Leetcode NO.202 Happy Number
本题题目要求如下: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum
2015-05-06 06:03:57 472
原创 Leetcode NO.206 Reverse Linked List
已经大概一个半月没有刷题了,今天开始恢复刷题。。当然,本周主要是刷简单题+做过的题压压惊并找找状态。。大概找个四五天再开始大量刷新题。。这学期课少,感觉好堕落。。连题也没怎么刷。。。目标是在6月中旬完成Leetcode所有题目,这样之后就基本是刷老题了。。之后再主刷CC 150.。 一个半月没刷题,果然状态下降明显,一道超简单的题写了20多分钟。。。 题目要求如下: Reverse
2015-05-05 07:49:42 536
Algorithm in C++, Part 1 - Part 4
2014-02-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人