原创 LeetCode Count of Smaller Numbers After Self

Description: You are given an integer array nums and you have to return a new counts array. The counts array has the

原创 LeetCode Remove Invalid Parentheses

Description: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all pos

原创 LeetCode Range Sum Query - Mutable

Description: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Th

原创 LeetCode Additive Number

Description: Additive number is a string whose digits can form additive sequence. A valid additive sequence should c

原创 LeetCode Maximum Product of Word Lengths

Description: Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two w

原创 LDA Gibbs Sampling公式推導

Gibbs Sampling Background 所有的推導可以說都是根據這張圖片: α∈RM×K θm∈RK β∈RK×V ϕk∈RV LDA的目的就是爲了在給定α,β 的情況下,求出θ 和ϕ 。 推導1 — 聯合分佈 求解

原创 LeetCode Create Maximum Number

Description: Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number

原创 Applied Natural Language Processing —— 讀書筆記 第二章

前一章描述了自然語言理解中關於人如何理解的部分,這個過程包含了內部和外部的信息。外部信息是通過視覺或者聽覺傳遞的語言內容,內部信息是個人關於這個時間和語言的知識。這些過程的結果就是使得人們能夠理解語言輸入。 解決自然語言理解包含三個問題,

原创 LeetCode Self Crossing

Description: You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the n

原创 LeetCode Odd Even Linked List

Description: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we

原创 使用Expedia API獲取航班信息

因爲做project需要,得獲取航班信息。 本來是想試試skyscanenr,然而申請API等了一週沒有結果……( ▼-▼ ) 有一個小點想提一下的是,在Expedia的API主頁上,給的請求網址是 http://terminal2.e

原创 LeetCode Verify Preorder Serialization of a Binary Tree

Description: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we

原创 LeetCode Super Ugly Number

Description: Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all pr

原创 LeetCode Longest Increasing Path in a Matrix

太久沒有回來寫了。寒假的時候把題目都刷完,這次暑假剛剛開始就正好可以刷一刷。 這道題目是經典dp題目,記得poj上面就有。 Description: Given an integer matrix, find the length of

原创 LeetCode Increasing Triplet Subsequence

Description: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.