
简介
该用户还未填写简介
擅长的技术栈
可提供的服务
暂无可提供的服务
原题https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/解法使用递归, base case是如果node为空, 返回None. 定义helper函数, 使用头结点和尾节点, 将子树的头结点和尾节点与母树相连.Time: O(v), v是二叉树的节点数目Space: O(...
原题You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modify the input 2D matrix d...
原题Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks. Tasks could be done without original order. Each task cou.
原题The count-and-say sequence is the sequence of integers with the first five terms as following:1112112111112211 is read off as “one 1” or 11.11 is read off as “two 1s” or 21....
原题https://leetcode.com/problems/intersection-of-two-linked-lists/解法链表A和链表B的长度可能不相等, 所以我们需要将较长的链表多出的节点忽略掉. 定义getLength函数计算链表的长度, 然后将较长的链表的head移动n次, n为多出的长度. 然后同时遍历链表A和链表B, 当headA == headB时, 返回节点. 这里...
原题Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = “11”, b = “1”Output: “100”Exampl...
原题Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Example:Input: nums = [1,2,3]Output:[[3],[1],[2...
0. 前言1. 用到的软件包2. 解析网页3. 数据清洗4. 词云5. 描述统计6. 实证统计7. 完整代码0. 前言本文从拉勾网爬取深圳市数据分析的职位信息,并以CSV格式保存至电脑, 之后进行数据清洗, 生成词云,进行描述统计和回归分析,最终得出结论.1. 用到的软件包Python版本: Python3.6requests: 下载网...
【前言】本文从豆瓣网爬取前250部电影,并以CSV格式下载至电脑。本人才疏学浅,如有不足之处,还请各位大神指正。【用到的软件包和知识点】requests:下载网页BeautifulSoup4:解析网页,提取所需数据 re:匹配正则表达式pandas:将数据转化为data frame, 再输出为csv格式【思路】采用divide-and-conquer方法,先对一个网页进行分析和抓取,再用循环,应用
【代码】11. 盛最多水的容器 @Python @Go。







