原创 Leetcode Minimum path sum

題目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the

原创 Leetcode House Robber

House Robber I題目描述 You are a professional robber planning to rob houses along a street. Each house has a certain amount

原创 Leetcode Merge k sorted lists

題目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 題目分析 將k個已經排好序的鏈表合

原创 leetcode easy題page1小結

Intro 之前一直埋頭於leetcode的medium和hard難度的題目,今天想變化一下,將第一頁的easy題刷完,並小結一下。 Q7 reverse integer Description: The input is assumed

原创 Leetcode 01 Matrix

題目 給出一個矩陣,尋找最近的零 題目解析 找出最近的零,相當於尋找一個最短路徑的問題,有兩種想法 思想一 暴力求解: 1. 先把0的位置存起來 2. 遇到1時,將每個1和0的歐式距離求出,取最小值 3. 返回最新的矩陣 這種思想

原创 Leetcode evaluate Division

題目 Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real num

原创 Leetcode 分治法

分治法 分治法的思想是將問題分而治之: 1. 將問題分成小問題 2. 分治完畢後,觸發遞歸中的結束判定語句 3. 將分治的結果 合併一起 求majority 題目 Given an array of size n, find the