fb
a568093361
这个作者很懒,什么都没留下…
展开
-
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 · 152 阅读 · 0 评论 -
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 · 112 阅读 · 0 评论 -
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 · 103 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 · 78 阅读 · 0 评论 -
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 · 106 阅读 · 0 评论 -
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 · 81 阅读 · 0 评论 -
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 · 138 阅读 · 0 评论 -
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 · 253 阅读 · 0 评论 -
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 · 139 阅读 · 0 评论 -
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 · 87 阅读 · 0 评论 -
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 · 238 阅读 · 0 评论 -
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 · 115 阅读 · 0 评论 -
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 · 186 阅读 · 0 评论 -
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 · 102 阅读 · 0 评论