![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
!&?
这个作者很懒,什么都没留下…
展开
-
剑指offer
剑指offer03. 数组中重复的数字(1)题目描述(2)思路与解法04. 二维数组中的查找(1)题目描述(2)思路与解法05. 替换空格(1)题目描述(2)思路与解法日期记录(更新题号)2020年10月12日03. 数组中重复的数字04. 二维数组中的查找05. 替换空格03. 数组中重复的数字(1)题目描述找出数组中重复的数字。在一个长度为 n 的数组 nums 里的所有数字都在 0~n-1 的范围内。数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字原创 2020-10-12 21:23:42 · 302 阅读 · 0 评论 -
重刷LeetCode-递归
重刷LeetCode-递归1137. 第 N 个泰波那契数(1)题目描述(2)思路与解法日期记录(更新题号)2020年8月17日1137. 第 N 个泰波那契数1137. 第 N 个泰波那契数(1)题目描述泰波那契序列 Tn 定义如下:T0 = 0, T1 = 1, T2 = 1, 且在 n >= 0 的条件下 Tn+3 = Tn + Tn+1 + Tn+2给你整数 n,请返回第 n 个泰波那契数 Tn 的值。来源:力扣(LeetCode)链接:https:原创 2020-08-17 23:34:01 · 182 阅读 · 0 评论 -
重刷LeetCode-脑筋急转弯
LeetCode-脑筋急转弯292. Nim 游戏(1)题目描述(2)思路与解法1227. 飞机座位分配概率(1)题目描述(2)思路与解法日期记录(更新题号)2020年8月13日292. Nim 游戏 1227. 飞机座位分配概率292. Nim 游戏(1)题目描述你和你的朋友,两个人一起玩 Nim 游戏:桌子上有一堆石头,每次你们轮流拿掉 1 - 3 块石头。 拿掉最后一块石头的人就是获胜者。你作为先手。你们是聪明人,每一步都是最优解。 编写一个函数,来判断你是否可以在原创 2020-08-13 22:55:21 · 328 阅读 · 0 评论 -
重刷LeetCode-数组
LeetCode-数组1480. 一维数组的动态和(1)题目描述(2)解法与思路1480. 一维数组的动态和(1)题目描述给你一个数组 nums 。数组「动态和」的计算公式为:runningSum[i] = sum(nums[0]…nums[i]) 。请返回 nums 的动态和。来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/running-sum-of-1d-array(2)解法与思路很简单。class Solution {原创 2020-08-11 20:43:44 · 350 阅读 · 0 评论 -
重刷LeetCode(简单篇)
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar原创 2020-08-03 20:24:49 · 251 阅读 · 0 评论 -
LeetCode——338. Counting Bits
题目描述Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example 1:Input: 2O...原创 2019-03-15 15:51:31 · 116 阅读 · 0 评论 -
LeetCode——303. Range Sum Query - Immutable
题目描述Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1su...原创 2019-03-15 12:41:00 · 120 阅读 · 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 ...原创 2019-03-15 12:24:59 · 90 阅读 · 0 评论 -
LeetCode——53. Maximum Subarray
题目描述Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Explana...原创 2019-03-15 11:06:02 · 113 阅读 · 0 评论 -
LeetCode——70. Climbing Stairs
70. Climbing StairsYou 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 ...原创 2019-01-09 18:28:13 · 189 阅读 · 0 评论 -
LeetCode——746. Min Cost Climbing Stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of t...原创 2019-01-09 18:14:19 · 90 阅读 · 0 评论 -
LeetCode——121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), ...原创 2019-01-08 20:53:41 · 91 阅读 · 0 评论 -
LeetCode——905. Sort Array By Parity
Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.You may return any answer array that satisfies this conditio...原创 2019-01-03 09:21:19 · 114 阅读 · 0 评论