自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【LEETCODE】64-Minimum Path Sum

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

2016-01-06 11:37:45 372

转载 【LEETCODE】75-Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0,

2016-01-05 19:14:26 556

原创 【LEETCODE】24-Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as2->1->4->3.Your algorithm should use only constant space. You

2016-01-05 16:54:50 422

原创 【LEETCODE】46-Permutations

Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2],[2,1,3], [2,3,1],[3,1,2], and [3,2,1].题意:

2016-01-05 15:01:56 632

转载 【LEETCODE】309-Best Time to Buy and Sell Stock with Cooldown

Say you have an array for which the ith element is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one

2016-01-05 11:57:18 1248

原创 【极客学院】-python学习笔记-2-Python特色,学习路线

极客学院课程地址:http://www.jikexueyuan.com/course/594.htmlPython功能强大:Python学习路线:Python的三大优点:简单,功能强大,面向对象面向对象:注重各个步骤间传递数据,实现更强大功能面向过程:程序注重一个一个步骤Python的七大特色:大小写严格区分简单,功能

2016-01-04 22:09:04 889

转载 【LEETCODE】230-Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the BST i

2016-01-04 15:20:24 575

原创 【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 dayi.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2016-01-04 14:34:07 366

原创 【极客学院】-iOS学习笔记-5-Swift(变量,循环,控制,函数,面向对象,小项目:呈现网页)

极客学院课程网址:http://www.jikexueyuan.com/course/92_2.html?ss=1变量,常量:var a = 1var b = 2a = 10let c = a+bprint(c)数据类型:var str="Hello"var s:String = "World"var i:Int = 100var words:String =

2016-01-02 11:00:29 602 3

原创 【极客学院】-iOS学习笔记-4-iOS程序打包与发布(模拟器运行,真机运行,发布到App Store)

极客学院课程地址:http://www.jikexueyuan.com/course/149_1.html?ss=1在模拟器中运行程序翻转屏幕:模拟器→Hardware回到主页面:command+shift+h在真机中运行程序在真机中运行程序,需要买苹果的开发者证书:developer.apple.com→Resources:iOS

2016-01-02 10:26:03 634

原创 【极客学院】-iOS学习笔记-3-Playground(可视化调试,帮助文档,如何提问)

极客学院课程网址:http://www.jikexueyuan.com/course/95_2.html?ss=1Playground:左边写代码,右边就即时地显示出变量的结果,还有图形可视化方便调试,把可能出错的代码放在这里运行iOS开发常用操作及技巧:

2015-12-31 17:10:30 1423

原创 【极客学院】-iOS学习笔记-2-Xcode(安装,创建项目,工作空间)

极客学院课程网址:http://www.jikexueyuan.com/course/118_2.html?ss=1创建ios Single View项目Create a new Xcode project⬇︎iOS→Application→Single View Application⬇︎填入product name,公司名字,公司ID,选择Swi

2015-12-31 11:05:07 1019

原创 【极客学院】-iOS学习笔记-iOS开发前准备(产品,系统,开发软硬件要求)

极客学院课程网址:http://www.jikexueyuan.com/course/137_3.html?ss=1苹果早期产品:1976年创立,推出200台Apple I,目前拍卖价格300多万美元1977年Apple II1980年Apple III1983年Apple Lisa1984年Macintosh1985年Windows,参考Macintosh的图

2015-12-31 10:11:15 866

原创 【LEETCODE】153-Find Minimum in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exists in the arr

2015-12-30 17:53:45 526

原创 【LEETCODE】12-Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.题意:给一个整数,将它转换成罗马数字,给的整数的范围在 1-3999参考:http://www.cnblogs.com/zuoyuan/p/377958

2015-12-30 17:18:09 514

原创 【LEETCODE】268-Missing Number

Given an array containing n distinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return2.Note:Your algorithm should ru

2015-12-30 16:09:10 601

原创 【LEETCODE】116-Populating Next Right Pointers in Each Node

Given a binary tree    struct TreeLinkNode {      TreeLinkNode *left;      TreeLinkNode *right;      TreeLinkNode *next;    }Populate each next pointer to point to its next right node.

2015-12-30 14:10:54 501

原创 【LEETCODE】238-Product of Array Except Self

Given an array of n integers where n > 1,nums, return an array output such thatoutput[i] is equal to the product of all the elements ofnums except nums[i].Solve it without division and in O(n)

2015-12-29 19:26:14 492

原创 【LEETCODE】35-Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2015-12-29 19:24:14 482

原创 【LEETCODE】319-Bulb Switcher

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off

2015-12-28 18:11:33 2526

原创 【LEETCODE】122-Best Time to Buy and Sell Stock II

Say you have an array for which the i th element is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on

2015-12-28 17:36:24 522

原创 【LEETCODE】260-Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums =

2015-12-28 16:00:10 536

原创 【LEETCODE】136-Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ext

2015-12-28 15:09:16 527

原创 【LEETCODE】223-Rectangle Area

Find the total area covered by two rectilinear rectangles in a2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that the total a

2015-12-28 12:23:48 481

原创 【LEETCODE】299-Bulls and Cows

You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint t

2015-12-26 21:23:54 644

原创 【LEETCODE】165-Compare Version Numbers

Compare two version numbers version1 and version2.If version1 > version2 return 1, ifversion1 version2 return -1, otherwise return 0.You may assume that the version strings are non-empty and c

2015-12-25 22:11:38 1005

原创 【LEETCODE】7-Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before coding.

2015-12-25 21:41:35 424

原创 【LEETCODE】67-Add Binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".题意:给两个二进制字符串,返回它们的和,同样是二进制字符串参考:http://www.cnblogs.com/asrman/p/397422

2015-12-25 20:43:40 391

原创 【LEETCODE】190-Reverse Bits

Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return 964176192 (represented in binary as001110010

2015-12-25 17:59:38 754

原创 【极客学院】-python学习笔记-Python快速入门(面向对象-引入外部文件-Web2Py创建网站)

极客学院-python学习笔记-Python快速入门(面向对象-引入外部文件)

2015-12-25 14:17:42 2110

原创 【LEETCODE】9-Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting th

2015-12-25 12:54:31 381

原创 【LEETCODE】112-Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum

2015-12-25 10:50:14 346

转载 【LEETCODE】172-Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes inn!.Note: Your solution should be in logarithmic time complexity.题意:给一个整数 n,返回 n! 的尾部是的0 的个数注意:解法需要满足对数时间复杂度参考:http://ww

2015-12-24 23:05:55 325

原创 【LEETCODE】231-Power of Two

Given an integer, write a function to determine if it is a power of two.题意:给一个整数,写一个函数判断它是否是2的幂参考:http://bookshadow.com/weblog/2015/07/06/leetcode-power-of-two/思路:如果一个整数是2的幂,

2015-12-24 22:49:05 310

原创 【LEETCODE】21-Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.题意:将两个排好序的list合并成一个参考:http://www.cnblogs.co

2015-12-24 22:02:01 573

原创 【LEETCODE】303-Range Sum Query - Immutable

Given an integer array nums, find the sum of the elements between indicesi and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1sum

2015-12-24 17:48:34 791

原创 【LEETCODE】278-First Bad Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the

2015-12-24 15:54:17 407

原创 【LEETCODE】38-Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or11.11 is read off as "two 1s" or21.21 is read off as "one

2015-12-23 19:50:16 414

原创 【LEETCODE】14-Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.

2015-12-23 19:45:16 367

原创 【LEETCODE】8-String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case

2015-12-23 14:09:10 319

空空如也

空空如也

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

TA关注的人

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