06 2020 档案

摘要:上升的温度 这是一道使用 sql 语句编程的题目 1. 地址 https://leetcode-cn.com/problems/rising-temperature/ 2. 解法 联表查询 注意联表的条件和取值 # Write your MySQL query statement below sel 阅读全文
posted @ 2020-06-21 21:14 吴丹阳-V 阅读(134) 评论(0) 推荐(0) 编辑
摘要:1、场景 使用 redis 作为延迟队列时,在 zrangebyscore 与 zrem 之间会存在 context switch 的情况,造成其他的消费者空转 在其他场景下可能会发生更严重的情况 在掘金小册《Redis 深度历险:核心原理与应用实践》第四章讲的比较清楚,最后作者留了一个思考题 使用 阅读全文
posted @ 2020-06-21 20:40 吴丹阳-V 阅读(3027) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-21 16:16 吴丹阳-V 阅读(395) 评论(0) 推荐(0) 编辑
摘要:第十行 shell 编程题目 1. 地址 https://leetcode-cn.com/problems/tenth-line/comments/ 2. 解法 最简洁的做法: awk 'NR==10' file.txt # NR 代表是行数 或者: sed -n 10p file.txt 阅读全文
posted @ 2020-06-20 20:50 吴丹阳-V 阅读(138) 评论(0) 推荐(0) 编辑
摘要:有效电话号码 shell 编程题目 考察了很多方面的内容 shell 命令 grep | sed | awk 正则表达式 shell 的转义处理 1. 地址 https://leetcode-cn.com/problems/valid-phone-numbers/ 2. 解法 你可以假设一个有效的电 阅读全文
posted @ 2020-06-15 23:39 吴丹阳-V 阅读(915) 评论(0) 推荐(0) 编辑
摘要:从不订购的客户 sql 编程 1. 地址 https://leetcode-cn.com/problems/customers-who-never-order/ 2. 解法 子查询 select Name as Customers from Customers where Id not in ( s 阅读全文
posted @ 2020-06-14 13:18 吴丹阳-V 阅读(138) 评论(0) 推荐(0) 编辑
摘要:查找重复的电子邮箱 sql 编程 1. 地址 https://leetcode-cn.com/problems/duplicate-emails/ 2. 解法 内连接,或者多表查询 email 相同,但是 id 不同的行 select distinct p1.Email from Person p1 阅读全文
posted @ 2020-06-14 13:14 吴丹阳-V 阅读(183) 评论(0) 推荐(0) 编辑
摘要:超过经理收入的员工 sql 编程 1. 地址 https://leetcode-cn.com/problems/employees-earning-more-than-their-managers/ 2. 解法 本质上就是内连接,然后算笛卡尔积之后过滤不符合的部分 # Write your MySQ 阅读全文
posted @ 2020-06-13 22:55 吴丹阳-V 阅读(171) 评论(0) 推荐(0) 编辑
摘要:第二高的薪水 这是一道使用 sql 语句编程的题目 1. 地址 https://leetcode-cn.com/problems/second-highest-salary/ 2. 解法 两种方法: 对表进行排序之后,使用 limit 取偏移量 select ( select distinct Sa 阅读全文
posted @ 2020-06-09 13:12 吴丹阳-V 阅读(143) 评论(0) 推荐(0) 编辑
摘要:Excel表列序号 1. 地址 https://leetcode-cn.com/problems/excel-sheet-column-number/ 2. 思路 代码即思路: class Solution { /** * @param String $s * @return Integer */ 阅读全文
posted @ 2020-06-08 13:08 吴丹阳-V 阅读(180) 评论(0) 推荐(0) 编辑
摘要:多数元素 1. 地址 https://leetcode-cn.com/problems/majority-element/ 2. 思路 解法一: 计算每个元素出现的次数 根据出现次数排序 取第一个 key class Solution { /** * @param Integer[] $nums * 阅读全文
posted @ 2020-06-07 15:11 吴丹阳-V 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Excel表列名称 1. 地址 https://leetcode-cn.com/problems/excel-sheet-column-title/ 2. 思路 进制转换的题目,但是对边界条件的处理并不是很好想 这题我看了题解: https://leetcode-cn.com/problems/ex 阅读全文
posted @ 2020-06-06 22:57 吴丹阳-V 阅读(197) 评论(0) 推荐(0) 编辑
摘要:1. 地址 https://leetcode-cn.com/problems/length-of-last-word/ 2. 思路 从尾往头算 第一个非空字符计数,一直算到空字符或者到头 3. 代码 class Solution { /** * @param String $s * @return 阅读全文
posted @ 2020-06-05 10:22 吴丹阳-V 阅读(135) 评论(0) 推荐(0) 编辑
摘要:1. 地址 https://leetcode-cn.com/problems/remove-element/ 2. 思路 双指针思想,一个保存下一个合法元素应该存放的位置,一个遍历数组 3. 代码 class Solution { /** * @param Integer[] $nums * @pa 阅读全文
posted @ 2020-06-04 22:14 吴丹阳-V 阅读(134) 评论(0) 推荐(0) 编辑
摘要:《向上生长》 这本书我已经看完了。 里面讲了很多理论知识,对于没有了解过的人,是个很大的提升,但是对于已经知道的人来说,可能会觉得老生常谈了一些。 后面几章讲了几个部分,对于像我这样的人事有学习意义的。 比如: 如何实现认知突围 怎么才能避免被娱乐致死,逃避丧尸文化的侵袭 年轻的时候应该怎么选择 选 阅读全文
posted @ 2020-06-04 13:41 吴丹阳-V 阅读(224) 评论(0) 推荐(0) 编辑
摘要:1. 地址 https://leetcode-cn.com/problems/palindrome-number 2. 思路 解法一:转成数组,看一下数组是不是回文数 解法二:从尾计算到一半,如果大于前半部分,则不是回文的,要注意是否是奇数位,奇数位的后半部分翻转之后会恒大于前半部分,需要再整除 1 阅读全文
posted @ 2020-06-03 23:27 吴丹阳-V 阅读(144) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示