118 Pascal Triangle 題意為給整數 numRows,回傳一個包含前 numRows 層的 Pascal Triangle 的 List。每一層...
重新調整從 Grind 75 開始,主要還是用 kotlin, 不過因未來會用到 java, python 所以也來複習一下吧。 1.Two Sum Ar...
21.Merge Two Sorted Lists Linked List, Easy introduction 合併兩個升序鏈表,並返回合併後的鏈表頭節點...
121 Best Time to Buy and Sell Stock 給定一組股票價格 prices[i],i 代表第 i 天的價格,你只能在某一天買入並在...
125 Valid Palindrome 給定字串,判斷它是否為迴文,僅考慮英數字元,忽略大小寫。 Kotlin, Two Pointers fun isP...
226 Invert Binary Tree 翻轉二元樹(左右子樹交換)。 Kotlin, DFS class TreeNode(var `val`: In...
242 Valid Anagram 判斷兩個字串是否為字母異位詞(相同字母但排列不同)。 kotlin class Solution { fun i...
704 Binary Search 在排序陣列中找到目標值,若存在回傳 index,不存在回傳 -1。 kotlin class Solution {...
733 Flood Fill 給一張圖像矩陣,從一個起點開始把所有相鄰(上下左右)的同色區域改成新的顏色。 kotlin, DFS class Soluti...