摘要:
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
随笔档案-2019年07月
[LeetCode] 81. Search in Rotated Sorted Array II_Medium tag: not real binary search anymore
2019-07-12 10:53 by Johnson_强生仔仔, 162 阅读, 收藏, 编辑
摘要:
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). Y 阅读全文
[LeetCode] 154. Find Minimum in Rotated Sorted Array II_Hard
2019-07-11 10:15 by Johnson_强生仔仔, 153 阅读, 收藏, 编辑
摘要:
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_强生仔仔, 238 阅读, 收藏, 编辑
摘要:
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_强生仔仔, 290 阅读, 收藏, 编辑
摘要:
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_强生仔仔, 244 阅读, 收藏, 编辑
摘要:
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_强生仔仔, 232 阅读, 收藏, 编辑
摘要:
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_强生仔仔, 237 阅读, 收藏, 编辑
摘要:
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 阅读全文