自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【LeetCode】126. Word Ladder II【H】

Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:Only one letter can be changed at a timeEac

2017-04-02 14:23:26 837

原创 【LeetCode】537. Complex Number Multiplication【M】

Given two strings representing two complex numbers.You need to return a string representing their multiplication. Note i2 = -1 according to the definition.Example 1:Input: "1+1i", "1+1i"O

2017-03-31 13:24:52 1070

原创 【LeetCode】526. Beautiful Arrangement【M】【35】【回溯】

Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of the following is true for the ith position (1 ≤ i

2017-03-31 13:23:39 808

原创 103. Binary Tree Zigzag Level Order Traversal【M】

Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binary

2017-03-29 10:09:58 393

原创 【LeetCode】504. Base 7【E】【94】

Given an integer, return its base 7 string representation.Example 1:Input: 100Output: "202"Example 2:Input: -7Output: "-10"Note: The input will be in range of [-1e7, 1e

2017-02-27 11:06:09 450

原创 【LeetCode】506. Relative Ranks【E】【50】

Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal".Example 1:In

2017-02-24 21:47:34 779

原创 【LeetCode】492. Construct the Rectangle【E】【73】

For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L

2017-02-23 16:23:15 558

原创 【LeetCode】520. Detect Capital【E】【83】

Given a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:All letters in t

2017-02-22 19:03:54 595

原创 【LeetCode】508. Most Frequent Subtree Sum【M】【40】

Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (includi

2017-02-22 13:34:02 537

原创 【LeetCode】442. Find All Duplicates in an Array【M】【60】

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without ex

2017-02-22 11:02:35 379

原创 【LeetCode】495. Teemo Attacking【M】【41】

In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascending time series towards Ashe and the poisoning tim

2017-02-21 18:45:39 593

原创 【LeetCode】515. Find Largest Value in Each Tree Row【E】【87】

You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]Subsc

2017-02-19 18:37:01 1267

原创 【LeetCode】451. Sort Characters By Frequency【M】【68】

Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Explanation:'e' appears twice while 'r' and 't' both appear once.So 'e

2017-02-19 10:30:50 418

原创 【LeetCode】448. Find All Numbers Disappeared in an Array【E】【77】

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this array.

2017-02-18 16:20:19 309

原创 【LeetCode】513. Find Bottom Left Tree Value【M】【73】

Given a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2: Input: 1 / \ 2 3

2017-02-18 13:19:05 943

原创 【LeetCode】496. Next Greater Element I【E】【94】

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums

2017-02-18 10:01:39 670

原创 【LeetCode】500. Keyboard Row【E】【75】

Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.Example 1:Input: ["Hello", "Alaska", "Da

2017-02-17 13:09:32 668

原创 【LeetCode】476. Number Complement【E】【59】

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range

2017-02-17 11:31:16 512

原创 【LeetCode】461. Hamming Distance【E】【90】

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x,

2017-02-16 12:32:05 499

转载 学习tensorflow之mac上安装tensorflow

背景听说谷歌的第二代机器学习的框架 tensorflow 开源了,我也心血来潮去探探大牛的产品.怎奈安装就折腾了一天,现在整理出来备忘. tensorflow官方网站给出的安装步骤很简单:# Only CPU-version is available at the moment.$ pip install https://storage.googleapis.com/tens

2016-12-19 16:10:49 1889

原创 【索引 index】是个好东西——大幅加快MySQL update更新速度的方法

去年这个时候,也是做数据库操作其中,是对主键为字符串的大概几万条的数据进行更新,就已经很慢了语句类似于这样:UPDATE persondata SET age=age+1 where name = '伏地魔';因为要全库去找,字符串比较,速度很慢,大概一秒钟几条,如果数据一行很长的话,可能会更慢忽然想起来,是不是可以建个索引然后就试着建了个索引,当点save的那

2016-12-14 17:09:40 24384 1

转载 C/C++中const关键字详解

原文:http://www.cnblogs.com/yc_sunniwell/archive/2010/07/14/1777416.htmlC/C++中const关键字详解    为什么使用const?采用符号常量写出的代码更容易维护;指针常常是边读边移动,而不是边写边移动;许多函数参数是只读不写的。const最常见用途是作为数组的界和switch分情况标号(也可以

2016-11-25 16:49:32 357

原创 GloVe 教程之实战入门+python gensim 词向量

前几天看论文,忽然看到了一个跟word2vec并列的词向量工具,这么厉害?还能跟word2vec相提并论?果断需要试试。GloVe 它来自斯坦福的一篇论文,GloVe全称应该是 Global Vectors for Word Representation官网在此 http://nlp.stanford.edu/projects/glove/

2016-11-25 13:20:17 43524 8

原创 【leetcode】454. 4Sum II【M】

Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make problem a bit easier, all A, B, C, D have same l

2016-11-22 13:11:12 1092

原创 【leetcode】462. Minimum Moves to Equal Array Elements II【M】

Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected element by

2016-11-21 14:03:14 726

原创 【leetcode】463. Island Perimeter【E】

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely

2016-11-21 13:06:13 1290

原创 【leetcode】435. Non-overlapping Intervals【M】

Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may assume the interval's end point is alw

2016-11-18 10:18:20 440

原创 【leetcode】459. Repeated Substring Pattern【E】

Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase Engli

2016-11-16 13:30:39 838

原创 【leetcode】455. Assign Cookies【E】

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a c

2016-11-16 11:04:10 554

原创 413. Arithmetic Slices 【M】

A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For example, these are arithmetic seque

2016-11-13 22:05:40 354

原创 405. Convert a Number to Hexadecimal【E】【leetcode】

Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.Note:All letters in hexadecimal (a-f) must be in lowercase.The hexade

2016-11-09 15:11:51 360

原创 【leetcode】【M】406. Queue Reconstruction by Height【95】

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of t

2016-11-09 14:10:22 362

原创 【leetcode】447. Number of Boomerangs【E】

Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals the distance between i and k (the order of t

2016-11-07 23:32:20 2289

原创 【leetcode】452. Minimum Number of Arrows to Burst Balloons【M】

There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordin

2016-11-07 16:24:52 550

原创 【leetcode】453. Minimum Moves to Equal Array Elements【E】

Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1.Example:Input:[1,2,3]Ou

2016-11-07 16:09:34 809

原创 401. Binary Watch【E】

A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).Each LED represents a zero or one, with the least significant bit o

2016-11-05 19:49:04 405

原创 【leetcode】382. Linked List Random Node【M】【74】

Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.Follow up:What if the linked list is extremely large and i

2016-11-04 21:41:09 407

原创 【leetcode】441. Arranging Coins【E】

You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the total number of full staircase rows that can be formed.

2016-11-02 21:46:38 416

原创 【leetcode】414. Third Maximum Number【E】【85】

Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3, 2,

2016-10-29 15:11:52 517

原创 【leetcode】419. Battleships in a Board【E】

Given an 2D board, count how many different battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may assume the following rules:You receiv

2016-10-29 00:09:40 449

空空如也

空空如也

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

TA关注的人

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