原创 【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 probabili

原创 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 u

原创 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 minu

原创 【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 coin

原创 413. Arithmetic Slices 【M】

A sequence of number is called arithmetic if it consists of at least three elements and if the difference between an

原创 【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] +

原创 【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 th

原创 【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)

原创 GloVe 教程之實戰入門+python gensim 詞向量

前幾天看論文,忽然看到了一個跟word2vec並列的詞向量工具,這麼厲害?還能跟word2vec相提並論? 果斷需要試試。 GloVe  它來自斯坦福的一篇論文,GloVe全稱應該是 Global Vectors for Word

原创 【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

原创 【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 sta

原创 【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 s

原创 【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 int

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

去年這個時候,也是做數據庫操作 其中,是對主鍵爲字符串的大概幾萬條的數據進行更新,就已經很慢了 語句類似於這樣: UPDATE persondata SET age=age+1 where name = '伏地魔'; 因爲要全庫去找

原创 【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