自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 leetcode-74 search a 2D matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each

2017-04-26 10:04:33 166

原创 leetcode-73 set matrix zeros

Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. 题意是将矩阵中,有0的行列值均置为0.这道题想要原址,首先需要记录下首行、首列,是否有0。其次从2行2列开始统计,如果有0,则将此位置的首行、首列位置记为0,实现原址。在改的时候应当注意,首行首列的值

2017-04-25 11:49:03 241

原创 leetcode-71 simplify path

Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"路径打印问题,将自己碰到的特殊情况记录如下1.两个"//"打印为一个"/"2.出现两个点"/../"

2017-04-17 11:48:17 165

原创 leetcode-68 Text Justification

题目如下:Given an array of words and a length L, format the text such that each line has exactlyL characters and is fully (left and right) justified. You should pack your words in a greedy approach;

2017-04-14 11:40:50 192

原创 leetcode-67 add binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".题意是将两个二进制串相加本题与上题类似,都是从后向前相加,维护一个进位。写的比较繁琐class Solution {public: stri

2017-04-12 11:11:44 231

原创 leetcode-66 plus one

这道题,从后向前依次加和,需要记录下进位,和处理最后的进位class Solution {public: vector plusOne(vector& digits) { vector res; vector tempres; int jinwei=0; int n = digits.size(); int num = digits[n-1] + 1; i

2017-04-12 10:39:18 164

原创 leetcode-65 valid number

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 to be amb

2017-04-11 11:43:22 213

原创 leetcode-59 Spiral Matrix

这是一道旋转矩阵的题,题目如下:Given an integer n, generate a square matrix filled with elements from 1 ton2 in spiral order.For example,Given n = 3, You should return the following matrix:[ [ 1, 2, 3

2017-04-07 15:22:25 145

原创 leetcode-57 insert interval

有了上道题的基础,这道题将新来的interval插入到原来的intervals当中,然后进行融合即可Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were i

2017-03-31 10:07:02 154

原创 leetcode-56 merge interval

题目如下Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. 首先对所有的interval进行排序,这里需要重载sort的比较操作符。其次对所有的int

2017-03-30 17:05:00 207

原创 leetcode-55 Jump Game

这道题本来准备用递归加回溯的方法做,也就是每次都移动最大,看看能到哪里,如果走不通,再退回一步。这样的做法,通过了72个案例,最后一个案例超时,无法通过。于是思考了贪心的方法,判断每个地方可以到达的最远距离。将两次过程记录下来第一次,class Solution {public: bool canJump(vector& nums) { if (nums.empty())

2017-03-30 15:17:51 158

转载 caffe提取特征并可视化

1. 配置python    详情见 http://www.cnblogs.com/alfredtofu/p/3577241.html    具体步骤  文件 python/requirements.txt 列举了Caffe依赖的python库,最简单的方法是用pip安装,pip的安装方法:curl -O https://raw.github.com/pypa/pip/mast

2016-08-28 15:58:41 594

空空如也

空空如也

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

TA关注的人

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