代码改变世界

[LeetCode] 154. Find Minimum in Rotated Sorted Array II_Hard

2019-07-11 10:15 by Johnson_强生仔仔, 153 阅读, 0 推荐, 收藏, 编辑
摘要: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]). F 阅读全文

[LeetCode] 17. Letter Combinations of a Phone Number_Medium tag: backtracking

2019-07-10 09:41 by Johnson_强生仔仔, 235 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文

[LeetCode] 93. Restore IP Addresses_Medium tag: backtracking

2019-07-09 10:15 by Johnson_强生仔仔, 287 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: Input: "25525511135" Output: ["255 阅读全文

[LeetCode] 322. Coin Change_Medium tag: backpack

2019-07-06 00:49 by Johnson_强生仔仔, 241 阅读, 0 推荐, 收藏, 编辑
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文

[LeetCode] 416. Partition Equal Subset Sum_Medium tag: backpack

2019-07-05 08:30 by Johnson_强生仔仔, 231 阅读, 0 推荐, 收藏, 编辑
摘要:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both 阅读全文

[LeetCode] 87. Scramble String_hard tag: 区间Dynamic Programming?

2019-07-05 07:01 by Johnson_强生仔仔, 220 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文

[LeetCode] 239. Sliding Window Maximum_Hard tag: deque

2019-06-26 11:03 by Johnson_强生仔仔, 189 阅读, 0 推荐, 收藏, 编辑
摘要: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 num 阅读全文

[LeetCode] 295. Find Median from Data Stream_hard tag: Heap Need to update the follow up question?

2019-06-13 09:49 by Johnson_强生仔仔, 207 阅读, 0 推荐, 收藏, 编辑
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文

[LeetCode] 407. Trapping Rain Water II_hard tag: Heap

2019-06-12 10:05 by Johnson_强生仔仔, 236 阅读, 0 推荐, 收藏, 编辑
摘要:Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to 阅读全文

[LeetCode] 16. 3Sum Closest_Medium tag: Array, Two pointers

2019-06-05 12:00 by Johnson_强生仔仔, 173 阅读, 0 推荐, 收藏, 编辑
摘要: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 thr 阅读全文
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 39 下一页