摘要: Python解决方法: class Solution(object): def sortArrayByParityII(self, A): j = 1 for i in xrange(0, len(A), 2): if A[i] % 2: while A[j] % 2: j += 2 A[i], A 阅读全文
posted @ 2019-12-25 10:20 HannahGreen 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Python解法代码: class Solution: def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: nums1.sort() nums2.sort() r = [] i = j = 0 while i < 阅读全文
posted @ 2019-12-24 14:26 HannahGreen 阅读(465) 评论(0) 推荐(0) 编辑
摘要: C++解题方法: class Solution { public: vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { unordered_set<int> u; vector<int> answer; for(int 阅读全文
posted @ 2019-12-24 10:54 HannahGreen 阅读(153) 评论(0) 推荐(0) 编辑
摘要: C++解题代码: class Solutiion { public: bool isAnagram(string s, string t) { int *data = new int[26](); int n = s.length(); int m = t.length(); int temp; i 阅读全文
posted @ 2019-12-24 09:49 HannahGreen 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 二分查询: def binary_search(list, item): low = 0 high = len(list)-1 while low <= high: mid = (low + high) / 2 guess = list[mid] if guess == item: return m 阅读全文
posted @ 2019-12-23 19:04 HannahGreen 阅读(923) 评论(1) 推荐(0) 编辑
摘要: if : elif : else : print('{0} \n{1} \n{2}' .format((a + b), (a - b), (a * b))) print(*[num**2 for num in range(n)], sep = '\n') def f(): return condit 阅读全文
posted @ 2019-12-19 08:43 HannahGreen 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 1. left join on 与 right join on, inner join on 的区别: left join on 把左表中的行全部展示,而将寻找右表中符合的行展示; right join on 把右表中的行全部展示,而将匹配左表中符合的行展示; inner join on 只展示两表 阅读全文
posted @ 2019-12-19 06:59 HannahGreen 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 主要涉及到: Python, MongoDB, Redis, MySQL以及python爬虫常用库的安装;可视化图形界面包括:Robo 3T,Redis, Navicat for MySQL python: 我电脑有python3.5 和3.7两个版本。环境是配置的sublime_text3 pyt 阅读全文
posted @ 2019-11-25 18:43 HannahGreen 阅读(451) 评论(0) 推荐(0) 编辑