[python3]参数中的冒号与箭头 冒号后面是建议传入的参数类型 箭头后面是建议函数返回的类型…
前面一篇“shell编程之变量篇”主要讲述下shell编程的变量的基本知识:设置变量的方式,自定义变量和环境变量的差别,变量的替换.删除.测试等. 这一篇主要是讲述在bash shell下的一些基本配置:别名,命令执行,配置文件的读取,可以自定义修改的配置文件. 别名设置 别名设置方式:alias       alias cl='clear' 如上所示的形式 如果希望每次启动shell都能使用这些别名的话,修改自己用户目录下的"~/.bashrc"配置文件,如下图,在文件中找一个适当的…
题目难度:Medium 题目: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution set must not contain duplicate quadrup…
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">leetcode第188题,Best Time to Buy and Sell Stock IV题目如下:</span> https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/ Say you hav…
题目:(据说是facebook的面试题哦) The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "one 2, then one 1&qu…
题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. 翻译: 给定一组整数,两个数字的返回索引,它们的和会等于一个特定…
在工程效率大行其道的今天,如果不会写点代码以后也不容易在测试圈混下去.今天给大家推荐一个LeetCode的刷题利器,可以伪装到连你老板在这里走过去都无法确认你是在干活呢,还是在干活呢. LeetCode是什么 leetcode是个题库,里面有很编程多面试的题目,可以在线编译运行.难度比较高.如果自己能都做出来,对面大公司很有帮助. 网址:https://leetcode.com/(如果对英文页面不爽的可以访问对应的中文页面:https://leetcode-cn.com/) 如果想在上面训练,首…
Dynamic Programming 实际上是[LeetCode] 系统刷题4_Binary Tree & Divide and Conquer的基础上,加上记忆化的过程.就是说,如果这个题目实际上是类似于Divide and conquer或者说是DFS,但是在计算过程中有很多重复计算同样的过程的话,那么就可以用Dynamic prgramming/记忆化搜索来完成.基本就是利用空间来简化时间复杂度的过程. 可以/很有可能使用Dynamic programming的条件,满足之一即可. 1.…
题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. 翻译: 给定一组整数,两个数字的返回索引,它们的和会等于一个特定…
一.起因 宅在家中,不知该做点什么.没有很好的想法,自己一直想提升技能,语言基础自不必言,数据结构还算熟悉,算法能力一般.于是乎,就去刷一通题. 刷题平台有很多,我选择了在leetcode进行刷题.回头看第一篇文章,还算有一些收获的. 传送门: 从心出发-刷leetcode写给5年后的自己,原计划用3个月的时间,回头来看第1轮100题用了刚好30天. 二.刷题方法及做法 自2020年1月22日开始,到2020年2月21日至,刷了top-100-liked-questions中的100道题目.普遍…