自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 71. Simplify Path

problem:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"这道题的要求是简化一个Unix风格下的文件的绝对路径。需注意以下几种情况:1.重

2017-01-25 11:15:21 226

原创 70. Climbing Stairs

problem:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n 

2017-01-15 14:11:16 242

原创 69. Sqrt(x)

problem:Implement int sqrt(int x).Compute and return the square root of x.本问题是完成开根号的操作。这道题使用二分查找,因为是求数x(x>=0) 的平方根, 因此,结果一定是小于等于x且大于等于0,所以用二分查找法肯定能搜到结果。以每一次的mid的平方来与target既数x相比:如

2017-01-15 13:56:27 374

原创 68. Text Justification

problem:Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You should pack your words in a greedy ap

2017-01-15 13:46:30 268

原创 67. Add Binary

problem:Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".这道题首先补齐较短的那个字符串,然后循环遍历即可class Solution {public: string addBin

2017-01-08 21:13:52 262

原创 66. Plus One

problem:Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itsel

2017-01-08 20:56:26 279

原创 65. Valid Number

problem:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement

2017-01-08 14:10:27 289

原创 64. Minimum Path Sum

problem:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either do

2017-01-04 21:55:49 254

原创 63. Unique Paths II

problem:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respecti

2017-01-04 21:01:54 201

原创 62. Unique Paths

problem:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying t

2017-01-04 20:18:56 230

原创 黑板课爬虫闯关第四关

在第三关过了之后,一直卡在第三关,我还不太明白是怎么回事,直接靠网址调到第四关。http://www.heibanke.com/lesson/crawler_ex03/点击进入页面后也是和第三关一样,需要登录才能进行下一步操作(如果之前登录了,服务器会根据浏览器保存的cookie自动返回登录后的页面)。登录后的页面如图:根据提示,密码不再是之前的30以内的数字了,是需要

2017-01-04 14:19:45 447

原创 黑板课爬虫闯关第三关

在前两关结束之后,进入第三关,这里需要我们注册,注册后再登录页面题目说比上一关多了两层保护,我们可以看到顶部有个注销按钮,也就是说首先要先登录才能继续做题。首先观察在登录的时候除了用户名和密码到底还发送了些什么。打开chrome,在登录界面,右键点开Inspect,然后在昵称和密码区域分别输入自己的用户名和密码,点击登录,可以在Network中看到如下的变化,

2017-01-04 12:21:56 561

原创 黑板课爬虫闯关第二关

通过第一关后,可以看到第二关的提示,在这里需要我们循环尝试密码。查看html源码:这里需要涉及到requests的post请求,并在请求里加上用户名username和密码password即可。# coding=utf-8import requestswrongNotify = '您输入的密码错误, 请重新输入'website = 'http://www.he

2017-01-04 11:20:03 373

原创 黑板课爬虫闯关第一关

之前也没有系统的学习过python,看其他源码的时候也是似懂非懂的看着理解意思。最近比较有空,就想更系统的学习一下,在知乎上看到大神推荐了一个Python爬虫闯关网站,便想试试。下面是第一关的介绍,黑板课爬虫第一关。点击进入网站以后,如下图所示:做了一下尝试,先手动在网址后面输入数字14901,得到下面结果。这个时候提示,要将数字改成63668,可以理解

2017-01-04 09:46:01 2301

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除