
LeetCode题库
zhengdadalalala
这个作者很懒,什么都没留下…
展开
-
leetcode——1-bit and 2-bit Characters
leetcode——1-bit and 2-bit Characters大致思路:从数组第一位开始遍历,所第i为值为1,则一定和下一位一起组成2bits,则i向后移动两位。若最后i移动到了最后一位(即i==len(bits)-1),则最后一位为1bit代码如下:class Solution(object): def isOneBitCharacter(self, bits): ...原创 2019-02-22 20:55:44 · 191 阅读 · 0 评论 -
LeetCode(198)——House Robber
题目:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent h...原创 2019-02-27 17:07:36 · 113 阅读 · 0 评论 -
leetcode——Longest Uncommon Subsequence I
python——Longest Uncommon Subsequence I题目:Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defined as ...原创 2019-02-23 11:45:36 · 118 阅读 · 0 评论 -
leetcode——Rotting Oranges
leetcode——Rotting Oranges(python)题目:In a given grid, each cell can have one of three values:the value 0 representing an empty cell;the value 1 representing a fresh orange;the value 2 representing...原创 2019-02-24 20:30:26 · 234 阅读 · 0 评论 -
leetcode——Maximum Product of Three Numbers(python)
leetcode——Maximum Product of Three Numbers题目:Given an integer array, find three numbers whose product is maximum and output the maximum product.大致思路:1)计算最小的两个负数以及最大的正数之间的乘积;2)计算最大的三个正数之间的乘积3)比较选...原创 2019-02-24 20:52:24 · 142 阅读 · 0 评论 -
LeetCode(771)——Jewels and Stones
题目:You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the...原创 2019-02-28 19:05:58 · 114 阅读 · 0 评论