- 博客(21)
- 资源 (1)
- 收藏
- 关注
原创 [LeetCode]Boats to Save People@Python
Boats to Save People The i-th person has weight people[i], and each boat can carry a maximum weight of limit. Each boat carries at most 2 people at the same time, provided the sum of the weight of tho...
2019-06-28 11:30:04 104
原创 [LeetCode]Advantage Shuffle@Python
Advantage Shuffle Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]. Return any permutation of A that maximizes its advan...
2019-06-28 10:23:44 280
原创 [LeetCode]Score After Flipping Matrix@Python
Score After Flipping Matrix We have a two dimensional matrix A where each value is 0 or 1. A move consists of choosing any row or column, and toggling each value in that row or column: changing all 0s...
2019-06-27 00:21:15 145
原创 [LeetCode]Split Array into Fibonacci Sequence@Python
Split Array into Fibonacci Sequence Given a string S of digits, such as S = “123456579”, we can split it into a Fibonacci-like sequence [123, 456, 579]. Formally, a Fibonacci-like sequence is a list F...
2019-06-26 00:10:14 103
原创 [LeetCode]Partition Labels@Python
Partition Labels A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integer...
2019-06-24 17:27:24 160
原创 [LeetCode]Monotone Increasing Digits@Python
Monotone Increasing Digits Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has monotone increasing digi...
2019-06-22 11:39:59 115
原创 [LeetCode]Lemonade Change@Python
Lemonade Change At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy o...
2019-06-21 00:52:28 112
原创 [LeetCode]Task Scheduler@Python
Task Scheduler 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. E...
2019-06-20 00:39:06 190
原创 垃圾回收机制
文章目录JS垃圾回收Java垃圾回收 JS垃圾回收 标记-清除算法,判断各对象从根出发的可达性,可达则标记,不可达则清除 Java垃圾回收 JAVA语言不允许程序员直接控制内存空间的使用。内存空间的分配和回收都是由JRE负责在后台自动进行的,尤其是无用内存空间的回收操作 (garbagecollection,也称垃圾回收),只能由运行环境提供的一个超级线程进行监测和控制。 垃圾回收器如发现一...
2019-06-19 16:18:40 149
原创 [LeetCode]Assign Cookies@Python
Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimu...
2019-06-18 22:26:35 161
原创 [LeetCode]Non-overlapping Intervals@Python
Non-overlapping Intervals Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note: You may assume the interval’...
2019-06-18 22:08:22 129
原创 [LeetCode]Queue Reconstruction by Height@Python
Queue Reconstruction by Height Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the num...
2019-06-14 23:58:57 123
原创 [LeetCode]Is Subsequence@Python
Is Subsequence Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 50...
2019-06-14 09:59:39 165
原创 [LeetCode]Wiggle Subsequence@Python
Wiggle Subsequence A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists...
2019-06-12 23:36:51 109
原创 [LeetCode]Gas Station@Python
Gas Station There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from statio...
2019-06-12 00:10:29 108
原创 [LeetCode]Jump Game@Python
Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determi...
2019-06-11 00:09:16 128
原创 [LeetCode]Remove K Digits@Python
Remove K Digits Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The length of num is less than 10002 an...
2019-06-09 01:25:41 127
原创 [LeetCode]Flatten Nested List Iterator@Python
Flatten Nested List Iterator Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list – whose elements may also be integers or other lists. Ex...
2019-06-09 00:55:08 153
原创 [LeetCode]Verify Preorder Serialization of a Binary Tree@Python
Verify Preorder Serialization of a Binary Tree One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node’s value. If it is a null node, we...
2019-06-08 23:22:59 136
原创 [LeetCode]132 Pattern@Python
132 Pattern Given a sequence of n integers a1, a2, …, an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm that takes a list of n numbers...
2019-06-08 22:09:27 209
原创 [LeetCode]Decode String@Python
Decode String Given an encoded string, return it’s decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note ...
2019-06-01 21:06:46 187
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人