原创 leetcode刷題筆記-難題整理

315. Count of Smaller Numbers After Self class Node: def __init__(self, val): self.val = val self

原创 leetcode刷題筆記-Greedy貪婪算法

45. Jump Game II 看完直接DP做, 倒數第二個test OTL。後改爲greedy, 思路其實差不多。

原创 NLP-Text Classifiers for Sentiment Analysis

Overview 1.Text Classification: In this assignment, you will use scikit-learn, a machine learning toolkit in Python, to

原创 leetcode刷題筆記-Monotonicqueue

239. Sliding Window Maximum  https://www.youtube.com/watch?v=2SXqBsTR6a8 class Solution(object): def maxSlidingWi

原创 leetcode刷題筆記-Parentheses

22. Generate Parentheses  dfs stack Given n pairs of parentheses, write a function to generate all combinations of well

原创 leetcode筆記-union find並查集

721. Accounts Merge class Solution(object): def init(self, accounts): self.parents = {} self.owne

原创 leetcode刷題筆記-tire

211. Add and Search Word - Data structure design class TrieNode(): def __init__(self): self.children = col

原创 leetcode刷題筆記-design

146. LRU Cache  解法一:OrderedDict , 太好用了,但是時間複雜度不是O(1) class LRUCache(object): def __init__(self, capacity):

原创 leetcode刷題筆記-binary search

74. Search a 2D Matrix class Solution(object): def searchMatrix(self, matrix, target): """ :type

原创 Leetcode刷題筆記-分治法divide and conquer

395. Longest Substring with At Least K Repeating Characters   Find the length of the longest substring T of a given str

原创 Machine Learning Project1, KNN

Header Name: Shusen Wu OS: Win10 Language: Python3.6 Environment: Jupyter Notebook Cite Machine Learning in Action, Pet

原创 Leetcode刷題筆記-sort

179. Largest Number class Solution(object): def largestNumber(self, nums): """ :type nums: List[i

原创 Leetcode刷題筆記-不知道怎麼分類的題

36. Valid Sudoku   class Solution(object): def isValidSudoku(self, board): """ :type board: List[

原创 Leetcode刷題筆記-linklist

2. Add Two Numbers 一遍過,有點簡單無腦  class Solution(object): def addTwoNumbers(self, l1, l2): """ :type

原创 leetcode刷題筆記-bit

136. Single Number 這題關鍵是最多的也只重複2次。 class Solution(object): def singleNumber(self, nums): """ :typ