- 博客(18)
- 收藏
- 关注
原创 LeetCode 刷题之路 Excel Sheet Column Title
Excel Sheet Column TitleGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 ...
2018-07-10 17:46:12
288
原创 LeetCode 刷题之路 Longest Word in Dictionary
Longest Word in DictionaryGiven a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If there i...
2018-06-30 18:15:29
249
原创 LeetCode 刷题之路 Map Sum Pairs
Map Sum PairsImplement a MapSum class with insert, and sum methods.For the method, insert, you'll be given a pair of (string, integer). The string represents the key and the integer represents the val...
2018-06-30 17:06:10
412
原创 LeetCode 刷题之路 Word Search II
Word Search IIGiven a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of the sequentially adjacent cell, where "adjacent" cells...
2018-06-30 12:33:14
227
原创 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 the sequentially adjacent cell, where "adjacent" cells are those horizontally or...
2018-06-29 18:00:35
201
原创 LeetCode 刷题之路 Implement Trie (Prefix Tree)
Implement Trie (Prefix Tree)Implement a trie with insert, search, and startsWith methods.Example:Trie trie = new Trie();trie.insert("apple");trie.search("apple"); // returns truetrie.search("app...
2018-06-29 11:10:30
254
转载 转载Java length, length(), size()
1 java中的length属性是针对数组说的,比如说你声明了一个数组,想知道这个数组的长度则用到了length这个属性.2 java中的length()方法是针对字符串String说的,如果想看这个字符串的长度则用到length()这个方法.3.java中的size()方法是针对泛型集合说的,如果想看这个泛型有多少个元素,就调用此方法来查看!这个例子来演示这两个方法和一个属性的用法public ...
2018-06-28 11:14:12
264
原创 LeetCode 刷题之路 Longest Substring Without Repeating Characters
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is ...
2018-06-27 22:44:27
175
原创 LeetCode 刷题之路 Multiply Strings
Multiply StringsGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.Example 1:Input: num1 = "2", num2 = "3"Output: ...
2018-06-20 21:48:17
250
原创 LeetCode 刷题之路 Add Binary
Add BinaryGiven two binary strings, return their sum (also a binary string).The input strings are both non-empty and contain only characters 1 or 0.Example 1:Input: a = "11", b = "1"Output: "100"Exam...
2018-06-13 16:49:40
263
原创 LeetCode 刷题之路 Add Two Numbers
Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contains a single digit. Add the two num...
2018-06-12 17:19:41
181
原创 LeetCode刷题之路 3Sum Smaller
3Sum SmallerGiven an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < ta...
2018-06-12 11:40:16
352
原创 LeetCode刷题之路 3Sum Closest
3Sum Closest Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each...
2018-06-12 11:40:09
215
原创 LeetCode刷题之路 3Sum
3SumGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not cont...
2018-06-12 11:40:03
216
原创 LeetCode刷题之路 Two Sum II - Input array is sorted
Two Sum II - Input array is sortedGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should re...
2018-06-12 11:39:58
208
原创 LeetCode刷题之路 Two Sum
Two Sum 两数之和Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use...
2018-06-12 11:39:49
207
原创 LeetCode 刷题之路 4Sum
4Sum Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum o...
2018-06-12 11:39:16
144
原创 LeetCode 刷题之路 4Sum II
4SumGiven four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make problem a bit easier, all A, B, C, D have same len...
2018-06-12 11:39:08
178
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人