- 博客(18)
- 资源 (1)
- 收藏
- 关注
原创 Leetcode NO.249 Group Shifted Strings
本题题目要求如下:Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequence:"abc" -> "bcd" -> ... -> "xy
2015-10-24 07:23:55 922
原创 Leetcode NO.270 Closest Binary Search Tree Value
本题题目要求如下:Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:Given target value is a floating point.You are guaranteed
2015-10-23 11:12:54 834
原创 Leetcode NO.246 Strobogrammatic Number
本题题目要求如下:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to determine if a number is strobogrammatic. The number is
2015-10-23 08:17:37 677
原创 Leetcode NO.252 Meeting Rooms
本题题目要求如下:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings.For example,Given [[0
2015-10-23 07:44:23 1755
原创 Leetcode NO.243 Shortest Word Distance
本题题目要求如下:Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list.For example,Assume that words = ["practice", "makes", "perfec
2015-10-23 07:19:50 713
原创 Leetcode NO.266 Palindrome Permutation
本题题目要求如下:Given a string, determine if a permutation of the string could form a palindrome.For example,"code" -> False, "aab" -> True, "carerac" -> True.这题是Easy题,所以难度不大,就是用hashmap来存储,不能
2015-10-20 05:41:37 713
原创 Leetcode NO.293 Flip Game
本题题目要求如下:You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take turns to flip twoconsecutive "++" i
2015-10-20 05:21:44 764
原创 Leetcode NO.8 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, please do not see below and ask yourself what are the po
2015-10-13 13:27:03 472
原创 Leetcode NO.125 Valid Palindrome
本题题目要求如下:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a
2015-10-11 05:39:03 530
原创 Leetcode NO.290 Word Pattern
本题题目要求如下:Given a pattern and a string str, find if str follows the same pattern.Examples:pattern = "abba", str = "dog cat cat dog" should return true.pattern = "abba", str = "dog
2015-10-08 04:50:16 404
原创 Leetcode NO.42 Trapping Rain Water
本题题目要求如下:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1
2015-10-08 04:19:58 421
原创 Leetcode NO.45 Jump Game II
本题题目要求如下:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.
2015-10-07 08:01:28 344
原创 Leetcode NO.55 Jump Game
本题题目要求如下:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.
2015-10-07 06:58:06 277
原创 Leetcode NO.278 First Bad Version
本题题目要求如下:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is develop
2015-10-07 05:48:58 356
原创 Leetcode NO.274 H-Index
本题题目要求如下:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to the definition of h-index on
2015-10-05 12:16:09 342
原创 Leetcode NO.53 Maximum Subarray
本题题目要求如下:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarra
2015-10-05 11:26:36 367
原创 Leetcode NO.232 Implement Queue using Stacks
本题题目要求如下:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front
2015-10-05 08:50:15 301
原创 Leetcode NO.223 Rectangle Area
本题题目要求如下:Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assum
2015-10-03 07:20:22 304
Algorithm in C++, Part 1 - Part 4
2014-02-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人