刷算法题
文章平均质量分 75
码农土豆
如果你一直不踏出第一步,就永远提不起干劲。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode刷题-190709-统计整形数组中不同值的数量
题目:Remove Duplicates from Sorted Array Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space for ano...原创 2019-07-09 10:09:05 · 229 阅读 · 0 评论 -
LeetCode刷题-190703-成对交换链表节点
题目: Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list’s nodes, only nodes itself may be changed. Example: Given 1-&...原创 2019-07-04 09:28:19 · 224 阅读 · 0 评论 -
LeetCode刷题-190709-扩展:阿拉伯数字和中文数字转换
前面刷过一个题,关于罗马字和阿拉伯数字转换,我之前的文章链接: https://blog.youkuaiyun.com/sleepingboy888/article/details/89814335 最近在看《算法的乐趣》王晓华著,其中的“阿拉伯数字和中文数字”。 阿拉伯数字转中文数字 ...原创 2019-07-11 13:23:46 · 7378 阅读 · 2 评论 -
LeetCode刷题-190715-字符串查找-两个int数除法
Implement strStr() Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = “hello”, needle = “ll” Out...原创 2019-07-25 13:30:03 · 219 阅读 · 0 评论 -
LeetCode刷题-190729-查找字符串中的单词组合
Substring with Concatenation of All Words You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenatio...原创 2019-07-30 15:49:40 · 758 阅读 · 0 评论 -
LeetCode刷题-190812-下一个排列(全排列知识扩展)
Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the ...原创 2019-08-13 14:51:44 · 361 阅读 · 0 评论 -
LeetCode刷题-190709-扩展:三水桶等分8升水的问题,妖怪和和尚过河问题
三水桶等分8升水的问题 参考书:《算法的乐趣》王晓华著 问题描述 有三个容积分别是 3 升、5 升和 8 升的水桶,其中容积为8升的水桶中装满水,容积为 3 升和容积为 5 升的水桶是空的。三个水桶都没有体积刻度,现在需要将大水桶中的8升水等分成两份,每份都是4升水,附加条件是只能使用另外两个空水桶,不能使用其他容器。 好像是小学的暑假作业中的题目,答案就不说了,主要分析如何用代码来解题。用人的思...原创 2019-08-12 09:56:49 · 1550 阅读 · 0 评论
分享