
lintcode
Atakey
写博文,从学生开始。
展开
-
Lintcode python之两数组的交
两数组的交 I II (Intersection of Two Arrays I & II)题目 I:返回两个数组的交 样例 nums1 = [1, 2, 2, 1], nums2 = [2, 2], 返回 [2]. python 的set集合就有交集的操作,而且顺带去重,简直爽歪歪,直接用set,一行代码搞定。class Solution: """ @param: nums1:原创 2017-10-04 22:20:51 · 374 阅读 · 0 评论 -
Lintcode Python之移动零
移动零(Move Zeroes)题目:给一个数组 nums 写一个函数将 0 移动到数组的最后面,非零元素保持原数组的顺序。样例:给出 nums = [0, 1, 0, 3, 12], 调用函数之后, nums = [1, 3, 12, 0, 0].注意事项1.必须在原数组上操作 2.最小化操作数原创 2017-10-11 21:48:01 · 552 阅读 · 0 评论 -
Lintcode答案查询
step 1获取原始题目链接,如 https://www.lintcode.com/problem/pour-water/description提取链接中problem和description之间的字符串 pour-waterstep 2进入查询网址 九章算法-答案查询输入 提取的字符串 pour-water 查找就可以喏...原创 2019-06-12 17:13:06 · 2843 阅读 · 1 评论