- 博客(18)
- 资源 (2)
- 收藏
- 关注
原创 Leetcode 83/82. Remove Duplicates from Sorted List II
83Given a sorted linked list, delete all duplicates such that each element appear only once.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->3->3Output...
2018-08-26 15:02:39
96
原创 Leetcode 32. Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: "(()"Output: 2Explanation: The longest valid...
2018-08-24 20:25:04
101
原创 Leetcode 336. Palindrome Pairs- FB tag
Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome.Example 1:Input: ["...
2018-08-13 23:48:59
124
原创 Leetcode 350 Intersection of Two Arrays II -Fb tag
Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as many times as...
2018-08-04 22:45:06
111
原创 Leetcode 239. Sliding Window Maximum
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window m...
2018-07-29 15:31:47
80
原创 LeetCode 210. Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: ...
2018-07-21 10:47:20
102
原创 Leetcode 56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlaps, mer...
2018-07-14 16:52:00
83
原创 Leetcode 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.The above elevation map is represented by array [0...
2018-07-14 01:07:38
77
原创 Leetcode 91. Decode Ways-Fb tag
A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given a non-empty string containing only digits, determine the to...
2018-07-04 13:35:36
103
原创 Leetcode 17. Letter Combinations of a Phone Number- Fb tag
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given...
2018-06-27 11:59:03
78
原创 Leetcode 158. Read N Characters Given Read4 II Fb tag
The API: int read4(char *buf) reads 4 characters at a time from a file.The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in the fil...
2018-06-26 12:35:44
134
原创 Leetcode 211.Add and Search Word - Data structure design Fb tag
Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regular expression string containing only letters a-...
2018-06-24 11:14:58
137
原创 Leetcode 311. Sparse Matrix Multiplication - Fb tag
Given two sparse matrices A and B, return the result of AB.You may assume that A's column number is equal to B's row number.Example:Input:A = [ [ 1, 0, 0], [-1, 0, 3]]B = [ [ 7, 0, 0 ], [...
2018-06-23 11:26:23
236
原创 leetcode 721. Accounts Merge FB-TAG
Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account.Now, ...
2018-06-21 22:37:57
185
原创 Leetcode 301. Remove Invalid Parentheses FB-TAG
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than the parentheses ( and ).Exam...
2018-06-18 16:18:30
252
原创 leetcode 238. Product of Array Except Self - FB tag
Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Example:Input: [1,2,3,4]Output: [24,1...
2018-06-16 09:58:57
86
原创 leetcode 282. Expression Add Operators
Given a string that contains only digits 0-9 and a target value, return all possibilities to add binaryoperators (not unary) +, -, or * between the digits so they evaluate to the target value.Example ...
2018-06-15 10:06:57
114
原创 leetcode 621 Task Scheduler -FB TAG
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks. Tasks could be done without original order. Each task could ...
2018-06-12 22:47:34
149
Microelectronics Circuit Analysis and Design 4th chapter 2 problems
2015-10-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人