- 博客(270)
- 收藏
- 关注
转载 133. Clone Graph
问题描述: Givena reference of a node in aconnectedundirected graph, return adeep copy(clone) of the graph. Each node in the graph contains a val (int) and a list (List[Node]) of its neighbors. ...
2019-09-27 04:44:00
224
转载 973. K Closest Points to Origin
问题描述: We have a list ofpointson the plane. Find theKclosest points to the origin(0, 0). (Here, the distance between two points on a plane is the Euclidean distance.) You may return the a...
2019-09-26 11:21:00
266
转载 238. Product of Array Except Self
问题描述: Given an arraynumsofnintegers wheren> 1, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i]. Example: Input: [1,2,3,...
2019-09-26 11:02:00
226
转载 953. Verifying an Alien Dictionary
问题描述: In an alien language, surprisingly they also use english lowercase letters, but possiblyin a differentorder. Theorderof the alphabetis some permutationof lowercase letters. Give...
2019-09-26 10:35:00
147
转载 9. Palindrome Number
问题描述: Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Outpu...
2019-07-29 13:09:00
109
转载 3. Longest Substring Without Repeating Characters
问题描述: Given a string, find the length of thelongest substringwithout repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. ...
2019-07-23 12:59:00
95
转载 399. Evaluate Division
问题描述: Equations are given in the formatA / B = k, whereAandBare variables represented as strings, andkis a real number (floating point number). Given some queries, return the answers. If t...
2019-04-18 12:22:00
121
转载 712. Minimum ASCII Delete Sum for Two Strings
问题描述: Given two stringss1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. Example 1: Input: s1 = "sea", s2 = "eat" Output: 231 Explanation: Deleting "s" from...
2018-08-24 07:48:00
124
转载 845. Longest Mountain in Array
问题描述: 845.Longest Mountain in Array DescriptionHintsSubmissionsDiscussSolution Pick One Let's call any (contiguous) subarray B (of A)amounta...
2018-08-24 07:17:00
120
转载 815. Bus Routes
问题描述: We have a list of bus routes. Eachroutes[i]is a bus route that the i-th busrepeats forever. For example ifroutes[0] = [1, 5, 7], this means that the firstbus (0-th indexed) travels in...
2018-08-24 06:14:00
145
转载 204. Count Primes
问题描述: Count the number of prime numbers less than a non-negative number,n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. 解题思路: ...
2018-08-16 09:33:00
84
转载 190. Reverse Bits
问题描述: Reverse bits of a given 32 bits unsigned integer. Example: Input: 43261596 Output: 964176192 Explanation: 43261596 represented in binary as 00000010100101000001111010011100, ...
2018-08-16 09:21:00
105
转载 154. Find Minimum in Rotated Sorted Array II
问题描述: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7]might become [4,5,6,7,0,1,2]). Find the minimum element. The ...
2018-08-16 08:59:00
94
转载 165. Compare Version Numbers
问题描述: Compare two version numbersversion1andversion2.Ifversion1>version2return1;ifversion1<version2return-1;otherwise return0. You may assume that the version strings are n...
2018-08-16 08:29:00
96
转载 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 t...
2018-08-16 08:06:00
105
转载 698. Partition to K Equal Sum Subsets
问题描述: Given an array of integersnumsand a positive integerk, find whether it's possible to divide this array intoknon-empty subsets whose sums are all equal. Example 1: Input: nums = [4, ...
2018-08-16 06:51:00
103
转载 445. Add Two Numbers II
问题描述: You are given twonon-emptylinked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two number...
2018-08-11 07:40:00
99
转载 582. Kill Process
问题描述: Givennprocesses, each process has a uniquePID (process id)and itsPPID (parent process id). Each process only has one parent process, but may have one or more children processes. This...
2018-08-11 07:15:00
116
转载 [转载][C++]拷贝构造函数和赋值运算符
原文地址:C++ 拷贝构造函数和赋值运算符 ----------------正文------------------------------------ 本文主要介绍了拷贝构造函数和赋值运算符的区别,以及在什么时候调用拷贝构造函数、什么情况下调用赋值运算符。最后,简单的分析了下深拷贝和浅拷贝的问题。 拷贝构造函数和赋值运算符 在默认情况下(用户没有定义,但是也没有显式的删除),编...
2018-08-10 03:39:00
59
转载 74. Search a 2D Matrix
问题描述: Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first i...
2018-08-10 02:05:00
62
转载 129. Sum Root to Leaf Numbers
问题描述: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3which represents the number123. F...
2018-08-10 01:09:00
92
转载 199. Binary Tree Right Side View
问题描述: Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom. Example: Input:[1,2,3,null,5,null,4] Outp...
2018-08-10 00:43:00
95
转载 831. Masking Personal Information
问题描述: We are given apersonal information stringS, which may representeitheran email addressora phone number. We would like to mask thispersonal information according to thefollowing rul...
2018-08-07 05:15:00
150
转载 516. Longest Palindromic Subsequence
问题描述: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: "bbbab" Output: 4 One possible long...
2018-08-05 13:51:00
63
转载 251. Flatten 2D Vector
问题描述: Implement an iterator to flatten a 2d vector. Example: Input: 2d vector = [ [1,2], [3], [4,5,6] ] Output: [1,2,3,4,5,6] Explanation:By calling next repeatedly until hasNext...
2018-08-05 12:59:00
84
转载 140. Word Break II
问题描述: Given anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, add spaces insto construct a sentence where each word is a valid dictionary word.Return all su...
2018-08-04 12:22:00
56
转载 296. Best Meeting Point
问题描述: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group. The dista...
2018-08-04 08:06:00
83
转载 450. Delete Node in a BST
问题描述: Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion can be...
2018-08-04 07:11:00
66
转载 290. Word Pattern
问题描述: Given apatternand a stringstr, find ifstrfollows the same pattern. Herefollowmeans a full match, such that there is a bijection between a letter inpatternand anon-emptyword in...
2018-08-03 08:26:00
59
转载 266. Palindrome Permutation
问题描述: Given a string, determine if a permutation of the string could form a palindrome. Example 1: Input: "code" Output: false Example 2: Input: "aab" Output: true Example 3: Input: "car...
2018-08-03 07:32:00
78
转载 186. Reverse Words in a String II
问题描述: Given an input string, reverse the string word by word. Example: Input: ["t","h","e"," ","s","k","y"," ","i","s"," ","b","l","u","e"] Output: ["b","l","u","e"," ","i","s"," ","s"...
2018-08-03 07:24:00
131
转载 648. Replace Words
问题描述: In English, we have a concept calledroot, which can be followed by some other words to form another longer word - let's call this wordsuccessor. For example, the rootan, followed byoth...
2018-08-03 06:59:00
74
转载 203. Remove Linked List Elements
问题描述: Remove all elements from a linked list of integers that have valueval. Example: Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2->3->4->5 解题思路: 需要注意...
2018-07-31 06:27:00
56
转载 442. Find All Duplicates in an Array
问题描述: Given an array of integers, 1 ≤ a[i] ≤n(n= size of array), some elements appeartwiceand others appearonce. Find all the elements that appeartwicein this array. Could you do it wi...
2018-07-31 06:19:00
64
转载 807. Max Increase to Keep City Skyline
问题描述: In a 2 dimensional arraygrid, each valuegrid[i][j]represents the height of a building located there. We are allowed to increase the height of any number of buildings, by any amount (the...
2018-07-31 05:31:00
76
转载 433. Minimum Genetic Mutation
问题描述: A gene string can be represented by an 8-character long string, with choices from"A","C","G","T". Suppose we need to investigate about a mutation (mutation from "start" to "end"), whe...
2018-07-31 05:08:00
81
转载 205. Isomorphic Strings
问题描述: Given two stringssandt, determine if they are isomorphic. Two strings are isomorphic if the characters inscan be replaced to gett. All occurrences of a character must be replaced w...
2018-07-31 04:38:00
61
转载 457. Circular Array Loop
问题描述: You are given an array of positive and negative integers. If a number n at an index is positive, then move forward n steps. Conversely, if it's negative (-n), move backward n steps. Assume...
2018-07-31 02:47:00
67
转载 735. Asteroid Collision
问题描述: We are given an arrayasteroidsof integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive mea...
2018-07-31 02:00:00
94
转载 722. Remove Comments
问题描述: Given a C++ program, remove comments from it. The programsourceis an array wheresource[i]is thei-th line of the source code. This represents the result of splitting the original sou...
2018-07-31 01:20:00
81
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人