自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 844.Backspace String Compare

Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.Example 1:Input: S = "ab#c", T = "ad#c"Output: trueExplanation: Bot...

2018-10-23 15:55:28 300

原创 # 682.Baseball Game

You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of points you get in ...

2018-10-23 15:36:09 207

原创 20.Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of b...

2018-10-22 18:25:06 205

原创 pyqt5.9+pycharm 安装配置

用pip 安装完pyqt之后是没有qt designer的执行pip install pyqt5-tools,然后去D:\python3.5\Lib\site-packages\pyqt5-tools 目录下拷贝designer.exe(每个人的python安装路径不一样)将pycharm内置两个工具 1. 增加QT设计界面“Qt Designer” — 这个就是设计Qt界面的工具 2....

2018-09-08 17:30:03 1238

原创 leetcode 709. To Lower Case

Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.     Example 1:        Input: "Hello"    Output: "hello"    Example 2:        Input...

2018-09-07 16:52:32 224

原创 leetcode 198. House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...

2018-08-30 16:54:27 237

原创 leetcode 121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...

2018-08-30 16:16:26 165

原创 70. Climbing Stairs

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 will be a positive...

2018-08-30 15:03:50 160

原创 746. Min Cost Climbing Stairs

On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of ...

2018-08-30 14:48:59 170

原创 leetcode 830. Positions of Large Groups

In a string S of lowercase letters, these letters form consecutive groups of the same character.For example, a string like S = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z" and "yy".Call

2018-08-29 16:42:09 29896

原创 leetcode 849. Maximize Distance to Closest Person

In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least one person sitting.Alex wants to sit in the s...

2018-08-29 15:22:21 193

原创 leetcode 832. Flipping an Image

Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.To flip an image horizontally means that each row of the image is reversed.  For examp...

2018-08-29 11:21:06 274 1

原创 leetcode 840. Magic Squares In Grid

A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.Given an grid of integers, how many 3 x 3 "magic sq...

2018-08-29 09:58:31 236

原创 leetcode 31. Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible ...

2018-08-27 10:20:13 422

原创 leetcode 27. Remove Element

Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input arra...

2018-08-25 16:01:39 168

原创 leetcode 26. Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifyi...

2018-08-25 15:18:01 240

原创 leetcode 11. Container With Most Water

Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two...

2018-08-25 11:00:46 164

原创 双栈实现队列操作

利用两个栈来实现一个队列,这里用的是自己写的栈、还有队列这两个数据结构。当然还可以利用继承的方式来实现队列,这里目前只有不用继承的方式。原理: 思路一: 将stack1作为存储空间,将stack2作为临时缓冲区 入队时:直接压入stack1 出队时:将stack1中的元素依次压入stack2中,再将stack2的栈顶元素弹出,最后将stack2中的元素再压回给stack1思路二: 入队时:判断st...

2018-07-12 11:05:36 786

原创 bwlabel实现(递归、一步法、两步法)

bwlabel的实现方法我这里列举三种(递归、一步法、两步法),其中递归方法和一步法很类似,只不过一步法中用了一个队列实现递归。主要思路: 递归:从上至下,从左至右,当搜索到第一个白色点并且其对应的output值没有被标签,然后开始从这个点搜索,在其八邻域内搜索,如果它满足是白色点并且其对应的output值没有被标签这个条件,就将这个点的八邻域继续搜索,这个地方可以使用递归实现. 但是递归方法没有...

2018-07-11 14:55:54 2191

原创 不使用imrotate实现图像旋转(点操作实现)

    不使用imrotate函数来实现图像旋转,这其中的原理就是使用点操作变换来实现的。    一般的我们实现图像旋转首先会想到将图像的旋转中心点平移到左上角的原点,经过旋转和平移的操作可以得到旋转之后的图像。        但是,我们如果直接将原图像平移、旋转、平移得到的新图像是有问题的,新图像中会有很多点没有值,使得图像像个蜂窝煤。这里需要使用逆向映射、最邻近插值(或者双线性插值)方法来解决...

2018-07-11 11:53:10 2225

原创 Windows下php执行exec函数调用python

Windows下php执行exec函数调用pythonPHP代码:<?php $var = 6; $var1 = 12; $l = exec("D:\python3.5\python hah.py $var $var1",$Array,$ret); //exec($String , $Array , $ret)函数有三个参数,$String 表示执行的语句,

2017-04-11 20:43:44 6456

转载 Python爬虫学习系列教程(2.7)

先贴转载地址:http://cuiqingcai.com/1052.html一、爬虫入门1. Python爬虫入门一之综述2. Python爬虫入门二之爬虫基础了解3. Python爬虫入门三之Urllib库的基本使用4. Python爬虫入门四之Urllib库的高级用法5. Python爬虫入门五之URLError异常处理6. Python

2017-03-14 11:30:36 738

原创 简单的python爬虫

参考别人的教程写的python爬虫,先贴上地址:http://python.jobbole.com/77825/再上代码:#缺乏异常处理,只能爬取静态页面import reimport urllib.requestimport urllibfrom collections import dequequeue = deque()visited = set()#已经爬取过的页面的集合url =

2017-03-14 09:44:44 436

空空如也

空空如也

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

TA关注的人

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