- 博客(13)
- 收藏
- 关注
原创 2021-05-16
第一周刷题121. Best Time to Buy and Sell Stock122. Best Time to Buy and Sell Stock II123. Best Time to Buy and Sell Stock III188. Best Time to Buy and Sell Stock IV
2021-05-16 22:29:45 95
原创 leetcode刷题-104.Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no children...
2019-08-21 18:46:50 118
原创 leetcode刷题-231.Power of Two
Given an integer, write a function to determine if it is a power of two.Example 1:Input: 1Output: trueExplanation: 20 = 1Example 2:Input: 16Output: trueExplanation: 24 = 16Example 3:Input...
2019-08-21 18:13:49 175
原创 leetcode刷题-169.Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element alwa...
2019-08-21 17:30:37 153
原创 python爬虫(四)——模拟登录丁香园
实战实战小项目:模拟登录丁香园,抓取论坛页面人员基本信息与回复帖子。丁香园论坛:http://www.dxy.cn/bbs/thread/626626#626626思路首先把登陆方式由扫码切换为账号密码登陆js1 = 'document.querySelector("#j_loginTab1").style.display="none";'browser.execute_script...
2019-08-13 09:51:52 340
原创 leetcode刷题-136.Single Number
Given a non-empty array of integers, every element appears twice except for one. Find that single one.Example 1:Input: [2,2,1]Output: 1Example 2:Input: [4,1,2,1,2]Output: 4找到数组中只出现一次的数,思路...
2019-08-12 20:49:21 116
原创 leetcode刷题-78.Subsets
Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Input: nums = [1,2,3]Output:[[3],[1],[2],[1,2,3...
2019-08-11 18:34:42 109
原创 python爬虫selenium (三)
selenium基本操作图片来自@huilai_sameselenium初体验from selenium import webdriverbrowser = webdriver.Chrome()browser.get("http://www.google.com")会自动打开谷歌浏览器进入首页selenium模拟登陆163邮箱import timefrom selenium...
2019-08-11 00:20:48 96
原创 leetcode刷题-148. Sort List
Sort a linked list in O(n log n) time using constant space complexity.Input: 4->2->1->3Output: 1->2->3->4Input: -1->5->3->4->0Output: -1->0->3->4->5这道题...
2019-08-10 21:02:13 117
原创 leetcode刷题-23.Merge K Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Input:[1->4->5,1->3->4,2->6]Output: 1->1->2->3->4->4->5->...
2019-08-09 20:55:34 224
原创 python爬虫(二)
BeautifulSoupbeautifulsoup中文官方文档博主曾经花时间将官方文档从头到尾看了一遍,结果是没几天就忘光光,之后幡然醒悟,官方文档是用来查的,不是用来记的,遇到问题查一下慢慢就有印象!爬取丁香园论坛回复from bs4 import BeautifulSoupimport requestsheaders = {"User-Agent": "Mozilla/5.0 (...
2019-08-08 21:07:18 168
原创 python爬虫(一)
get与post印象中get是请求数据,post是提交数据,然后博主在网上查了这个问题,一些比较深入的原理性的解释并没有看懂,所以下面放的是w3school给的二者之间的差别,日后真正需要理解原理再看原理1.get/test/demo_form.asp?name1=value1&name2=value2//get请求的参数可以直接在网址中看到2.postPOST /test/...
2019-08-07 10:14:06 170
原创 伯克利CS61A-Sum2019-Week1
CS61A被公认为伯克利的一门神课,主讲语言为python,学透彻编程能力会有质的飞跃(个人观点),课程中的所有lab,hw,pro都可以下载练习,课程体验很棒~博主19年寒假的时候学习了一部分,准备利用暑假时间整理+学习课程网址:https://cs61a.org/基本操作课程用的sublime,轻量级没法直接运行,高亮体验很棒~写好后进入命令行交互运行 python3 -i lab01...
2019-08-06 15:45:22 4109
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人