iT邦幫忙

leetcode相關文章
共有 1099 則文章
鐵人賽 自我挑戰組 DAY 28
30天leetcode學習旅程 系列 第 28

技術 項次 28 - 1-Dimension DP

題目:198. House Robber 連結:https://leetcode.com/problems/house-robber/description/...

鐵人賽 自我挑戰組 DAY 23
Leetcode 各主題解題攻略 系列 第 23

技術 Union-Find 攻略 part2

Hi 大家好,今天要來挑戰Union-Find的進階題。要找出在哪邊使用union-find是這題的挑戰,讓我們速戰速決吧。 Leetcode 721. Ac...

鐵人賽 Mobile Development DAY 23

技術 Day 23: SwiftUI 紀錄收藏的 LeetCode 題目:UserDefaults 和 @AppStorage

LeetCode 題目隨著我們一題一題實作過後,我們需要知道到底做過了多少題目,將它收藏起來,不想要打開 App 的時候發現怎麼跟剛下載的一樣,一點變化都沒有,...

鐵人賽 自我挑戰組 DAY 30

技術 Day30-[Grind 169 questions[Binary Tree] LeeCode 101、863、572 & 完賽心得

完賽心得 今年參加鐵人賽,個人感覺是水過一年的感覺XD,因為就只是把解題的練習記錄複製貼上來,但今年因為沒有備太多天的稿,所以在時程的壓力下,的確有達到督促自己...

鐵人賽 自我挑戰組 DAY 29

技術 Day29-[Grind 169 questions[Binary Tree] LeeCode 100、103、437

100. Same Tree 解題程式碼 var isSameTree = function (p, q) { if (p === null &&a...

鐵人賽 自我挑戰組 DAY 22

技術 Day22 - Linked List - Conclusion Problem 4

138. Copy List with Random Pointer 題目 A linked list of length n is given such th...

鐵人賽 Software Development DAY 22
Leetcode 習慣養成之路 系列 第 22

技術 Day 22 - 225. Implement Stack using Queues

題目說明 請用 queue 製作一個 stack 解題思路 這一類型的題目,在實作過程中勢必會有一種操作會需要耗費 O(n) 的時間複雜度以這題為例,會是以 p...

鐵人賽 Mobile Development DAY 22

技術 Day 22: 導讀 LeetCode 演算法- Binary Search (Swift)

本篇要來介紹 LeetCode 超常見的主題 Binary Search,中文就是 二分搜尋演算法,以往我們在查找陣列的某一個值的時候,最直覺的做法是一個一個從...

鐵人賽 自我挑戰組 DAY 22
Leetcode 各主題解題攻略 系列 第 22

技術 Union-Find 攻略 part1

大家好,今天要來分享union-find,這個主題可以歸類於Graph的演算法,最為人常知的應用在找出圖中是否有cycle或是有幾個connected comp...

鐵人賽 自我挑戰組 DAY 24
30天leetcode學習旅程 系列 第 24

技術 項次 24 - Matrix DFS

題目:200. Number of Islands 連結:https://leetcode.com/problems/number-of-islands/des...

鐵人賽 自我挑戰組 DAY 28

技術 Day28-[Grind 169 questions[Binary Tree] LeeCode 105、113、662

105. Construct Binary Tree from Preorder and Inorder Traversal 解題程式碼 var buildTr...

鐵人賽 自我挑戰組 DAY 27

技術 Day27-[Grind 169 questions[Binary Tree] LeeCode 543、199、104

543. Diameter of Binary Tree 解題程式碼 var diameterOfBinaryTree = function(root) {...

鐵人賽 自我挑戰組 DAY 24

技術 Day24-[Grind 169 questions][Binary] LeeCode 190、13、528

190. Reverse Bits 解題程式碼 var reverseBits = function (n) { let result = 0; for...

鐵人賽 自我挑戰組 DAY 23

技術 Day23-[Grind 169 questions][Binary] LeeCode 191、136、268

191. Number of 1 Bits 解題程式碼 var hammingWeight = function (n) { let count = 0;...

鐵人賽 自我挑戰組 DAY 21
Leetcode 各主題解題攻略 系列 第 21

技術 Graph 攻略 part7

Hi 大家好,今天要先補齊昨天原本就要分享完的Topological sort的題目。...原本是打算講解完題目後接著介紹Union-Find,但是這個題目的解...

鐵人賽 Software Development DAY 21
Leetcode 習慣養成之路 系列 第 21

技術 Day 21 - 328. Odd Even Linked List

題目說明 給定一個 linked list,回傳一個奇數點位排前面,偶數點位接續在奇數點位後面的 linked list並且要使用 O(1)的空間複雜度與 O(...

鐵人賽 自我挑戰組 DAY 22

技術 Day22-[Grind 169 questions][Binary] LeeCode 67、287、338

67. Add Binary 解題程式碼 var addBinary = function (a, b) { let carry = 0; let re...

鐵人賽 自我挑戰組 DAY 21

技術 Day21-[Grind 169 questions][String] LeeCode 14、179、271

14. Longest Common Prefix 解題程式碼 var longestCommonPrefix = function (strs) { if...

鐵人賽 Software Development DAY 20
Leetcode 習慣養成之路 系列 第 20

技術 Day 20 - 92. Reverse Linked List II

題目說明 這是 reverse linked list 的進階題 # Definition for singly-linked list. # class Li...

鐵人賽 自我挑戰組 DAY 21

技術 Day21 - Linked List - Conclusion Problem 3

61. Rotate List 題目 Given the head of a linked list, rotate the list to the right...

鐵人賽 自我挑戰組 DAY 20

技術 Day20 - Linked List - Conclusion Problem 2

430. Flatten a Multilevel Doubly Linked List 題目 You are given a doubly linked li...

鐵人賽 自我挑戰組 DAY 20
Leetcode 各主題解題攻略 系列 第 20

技術 Graph 攻略 part6

今天要來繼續分享Topological sort在leetcode上的題目,這個主題的題目沒有easy難度的。只有Medium和Hard,算是不簡單的主題。今天...

鐵人賽 自我挑戰組 DAY 20

技術 Day20-[Grind 169 questions][String] LeeCode 438、49、424

438. Find All Anagrams in a String 解題程式碼 const alphabets = 'abcdefghijklmnopqrst...

鐵人賽 Mobile Development DAY 20

技術 Day 20: 導讀 LeetCode 演算法 - Tree 的 DFS 與 BFS (Swift)

今天第二十天表示三十天挑戰過了三分之二,而要學的 LeetCode 演算法或是資料結構的知識也會逐步深入,SwiftUI 套入 App 的應用也會越來越多元,而...

鐵人賽 自我挑戰組 DAY 19

技術 Day19 - Linked List - Conclusion Problem 1

21. Merge Two Sorted Lists 題目 You are given the heads of two sorted linked lists...

鐵人賽 Software Development DAY 19
Leetcode 習慣養成之路 系列 第 19

技術 Day 19 - 141. Linked List Cycle

最近的題目都偏簡單 >< 題目說明 找到 linked list 有沒有環 解法 使用快慢指針,如果兩個指針走著走著相遇了,代表必定有環 # Def...

鐵人賽 Software Development DAY 18
Leetcode 習慣養成之路 系列 第 18

技術 Day 18 - 160. Intersection of Two Linked Lists

題目說明 給定兩個 linkedlist ,找到他們的交集處 解題說明 這題只要用兩個 pointer,走訪完兩個 list 就可以找到交集處交集處為第一個位置...

鐵人賽 自我挑戰組 DAY 18
Leetcode 各主題解題攻略 系列 第 18

技術 Graph 攻略 part4

Hi 大家好,今天來分享BFS在Matrix的應用。BFS如果應用在像binary tree上的話,我們每一次都會一次拜訪到同一個Level上的所有的所有節點。...

鐵人賽 Mobile Development DAY 18

技術 Day 18: 導讀 LeetCode 演算法 - Backtracking (Swift)

這篇我們要介紹 LeetCode 題目常見會運用到的演算法,也就是 Backstracking ,翻譯成中文叫做回溯演算法,這個演算法著重在會列舉所有的可能性,...