![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
Pennhhe
对时间有耐心
展开
-
【LeetCode】474. 一和零 (动态规划)
1. 问题描述在计算机界中,我们总是追求用有限的资源获取最大的收益。现在,假设你分别支配着 m 个 0 和 n 个 1。另外,还有一个仅包含 0 和 1 字符串的数组。你的任务是使用给定的 m 个 0 和 n 个 1 ,找到能拼出存在于数组中的字符串的最大数量。每个 0 和 1 至多被使用一次。示例 1:输入: strs = ["10", "0001", "111001", "1", "0"], m = 5, n = 3输出: 4解释: 总共 4 个字符串可以通过 5 个 0 和 3 个 1原创 2020-10-11 16:35:38 · 147 阅读 · 0 评论 -
【LeetCode数组】15. 3Sum
1. 审题such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not contain duplicate triplets.Example:Given array nums = [-1, 0, 1, 2, ...原创 2019-11-30 21:02:23 · 72 阅读 · 0 评论 -
【LeetCode数组】70. Climbing Stairs
1. 审题You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a posi...原创 2019-11-30 19:43:54 · 93 阅读 · 0 评论 -
【LeetCode数组】11. Container With Most Water
1.审题Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoi...原创 2019-11-30 19:34:52 · 82 阅读 · 0 评论 -
【LeetCode数组】 283 Move Zeros
1. 刷题套路刷题遵循以下步骤(参考覃超在极客时间在算法训练营中的讲解):读题,审题,看看有没有思路。尝试从以下几个角度出发进行思考:暴力解法尝试优化没有思路的话,跳转discuss,阅读题解参照discuss思路,尝试自己写出代码在白纸上写出代码跳转discuss,翻阅其他人的解法,提供多种思路。2. 刷题感悟计算机程序的运行无非 if else 分支跳转,循环运行...原创 2019-11-30 19:15:15 · 167 阅读 · 0 评论