iT邦幫忙

leetcode相關文章
共有 943 則文章
鐵人賽 Software Development DAY 5
從LeetCode學演算法 系列 第 5

技術 [Day 5] 從LeetCode學演算法 - 0021. Merge Two Sorted Lists (Easy)

目標:這題主要目的在於引導讀者了解Linked List的資料結構以及基本操作。 原題: Question: Merge two sorted linked l...

鐵人賽 自我挑戰組 DAY 4
Leetcode新手挑戰30天 系列 第 4

技術 #9 Palindrome Number - 繼續解

前情提要 昨天解完題後跑測試個案,發現負數的test case都跑不過,會出現這個錯誤:Line 3: ValueError: invalid literal...

鐵人賽 自我挑戰組 DAY 4
刷題記錄與人生分享 系列 第 4

技術 DAY 4 Valid Parentheses

題目: https://leetcode.com/problems/valid-parentheses/一個字串中包含'(' , ')', '{', '}',...

鐵人賽 Software Development DAY 4
從LeetCode學演算法 系列 第 4

技術 [Day 4] 從LeetCode學演算法 - 0015. 3Sum (Medium)

目標:這題主要目的在於練習Two Pointer類型的問題應用。 原題: Question: Given an array nums of n integers...

鐵人賽 自我挑戰組 DAY 3
Leetcode新手挑戰30天 系列 第 3

技術 #9 Palindrome Number

寫在開頭 因為Hash Table沒有這麼深刻的學習心得可以分享,就只先把查到覺得挺有用的資料先更新在Day2的文章裡,決定先繼續解下個題目Palindrome...

鐵人賽 自我挑戰組 DAY 3
刷題記錄與人生分享 系列 第 3

技術 DAY3 Reverse Integer

題目: https://leetcode.com/problems/reverse-integer/反轉32bits的整數,須注意溢位的問題。 解題思路: 藉由...

鐵人賽 Software Development DAY 3
從LeetCode學演算法 系列 第 3

技術 [Day 3] 從LeetCode學演算法 - 0014. Longest Common Prefix (Easy)

目標:這題主要目的在於練習常見的字串比對處理。 原題: Question: Write a function to find the longest commo...

鐵人賽 自我挑戰組 DAY 2
Leetcode新手挑戰30天 系列 第 2

技術 #1 Two Sum - 研究其他種解法

寫在開頭 昨天解Two Sum的時候用巢狀迴圈的方式寫,最後Submit的結果是但在昨天找到的文章分享中,看到幾個解法,今天想在研究研究 其他解法1: k =...

鐵人賽 自我挑戰組 DAY 2
刷題記錄與人生分享 系列 第 2

技術 Day2 Two Sum

題目: https://leetcode.com/problems/two-sum/給一個陣列,返回兩個數字的索引,使它們相加到特定目標。 解題思路: 使用2個...

鐵人賽 Software Development DAY 2
從LeetCode學演算法 系列 第 2

達標好文 技術 [Day 2] 從LeetCode學演算法 - 0001. Two Sum (Easy)

目標:這題主要目的在於練習HashMap/Dictionary的應用。 原題: Question: Given an array of integers, re...

鐵人賽 自我挑戰組 DAY 1
Leetcode新手挑戰30天 系列 第 1

技術 #1 Two Sum

寫在開頭 第一次參加鐵人賽,也是第一次挑戰寫Leetcode題目。滿緊張的,一開始想報名鐵人賽主題的時候突然想起同事A在離職前幾個月曾經跟我說過聽著特別熱血,但...

鐵人賽 Software Development DAY 1
從LeetCode學演算法 系列 第 1

達標好文 技術 [Day 1] 從LeetCode學演算法 - 緒論:你應該知道的面試基礎和解題技巧

寫在前面 容許筆者自我工商一下,如果喜歡這一系列的文章,我也有陸續寫新的文章,放在我的Medium中,有興趣的歡迎光臨XD~ 其目錄項次會放在第一篇(在Medi...

技術 [LeetCode]N-Queens經典問題八皇后

前言 今日感冒在家剛好利用時間打一篇文章,天氣變冷了大家要多注意保暖阿。 題目 給定數字n,並列出n * n皇后所有可能。 輸入 4 輸出 [ [&quot...

鐵人賽 自我挑戰組 DAY 30
LeetCode - 30 Days 系列 第 30

技術 [Leetcode-30/30][Combinations] #39 Combination Sum、結語

#39 Combination Sum 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given a set of candida...

鐵人賽 自我挑戰組 DAY 29
LeetCode - 30 Days 系列 第 29

技術 [Leetcode-29/30][Combinations] #77 Combinations

#77 Combinations 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given two integers n and...

鐵人賽 自我挑戰組 DAY 28
LeetCode - 30 Days 系列 第 28

技術 [Leetcode-28/30][Permutations] #46 Permutations

#46 Permutations 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given a collection of dis...

鐵人賽 自我挑戰組 DAY 27
LeetCode - 30 Days 系列 第 27

技術 [Leetcode-27/30][Bit Manipulation] #371 Sum of Two Integers

#371 Sum of Two Integers 同步發佈於 Github repo 題目難度:Easy 題目敘述: Calculate the sum o...

鐵人賽 自我挑戰組 DAY 26
LeetCode - 30 Days 系列 第 26

技術 [Leetcode-26/30][Bit Manipulation] #137 Single Number II

#137 Single Number II 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given an array of in...

鐵人賽 自我挑戰組 DAY 25
LeetCode - 30 Days 系列 第 25

技術 [Leetcode-25/30][Bit Manipulation] #405 Convert a Number to Hexadecimal

#405 Convert a Number to Hexadecimal 同步發佈於 Github repo 題目難度:Easy 題目敘述: Given a...

鐵人賽 自我挑戰組 DAY 24
LeetCode - 30 Days 系列 第 24

技術 [Leetcode-24/30][Dynamic Programming] #377 Combination Sum IV

#377 Combination Sum IV 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given an integer a...

鐵人賽 自我挑戰組 DAY 23
LeetCode - 30 Days 系列 第 23

技術 [Leetcode-23/30][Dynamic Programming] #322 Coin Change

#322 Coin Change 同步發佈於 Github repo 題目難度:Medium 題目敘述: You are given coins of di...

鐵人賽 自我挑戰組 DAY 22
LeetCode - 30 Days 系列 第 22

技術 [Leetcode-22/30][Dynamic Programming] #213 House Robber II

#213 House Robber II 同步發佈於 Github repo 題目難度:Medium 題目敘述: Note: This is an exte...

鐵人賽 自我挑戰組 DAY 21
LeetCode - 30 Days 系列 第 21

技術 [Leetcode-21/30][Sort] #274 H-Index

#274 H-Index 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given an array of citations (...

鐵人賽 自我挑戰組 DAY 20
LeetCode - 30 Days 系列 第 20

技術 [Leetcode-20/30][Sort] #179 Largest Number

#179 Largest Number 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given a list of non ne...

鐵人賽 自我挑戰組 DAY 19
LeetCode - 30 Days 系列 第 19

技術 [Leetcode-19/30][Sort] #75 Sort Colors

#75 Sort Colors 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given an array with n obje...

鐵人賽 自我挑戰組 DAY 18
LeetCode - 30 Days 系列 第 18

技術 [Leetcode-18/30][Graph] #133 Clone Graph

#133 Clone Graph 同步發佈於Github repo 題目難度:Medium 題目敘述: Clone an undirected graph....

鐵人賽 自我挑戰組 DAY 17
LeetCode - 30 Days 系列 第 17

技術 [Leetcode-17/30][Graph] #210 Course Schedule II

#210 Course Schedule II 同步發佈於 Github repo 題目難度:Medium 題目敘述: There are a total...

鐵人賽 自我挑戰組 DAY 16
LeetCode - 30 Days 系列 第 16

技術 [Leetcode-16/30][Graph] #207 Course Schedule

#207 Course Schedule 同步發佈於 Github repo 題目難度:Medium 題目敘述: There are a total of...

鐵人賽 自我挑戰組 DAY 15
LeetCode - 30 Days 系列 第 15

技術 [Leetcode-15/30][Tree] #129 Sum Root to Leaf Numbers

#129 Sum Root to Leaf Numbers 同步發佈於 Github repo 題目難度:Medium 題目敘述: Given a bina...

鐵人賽 自我挑戰組 DAY 14
LeetCode - 30 Days 系列 第 14

技術 [Leetcode-14/30][Tree] #114 Flatten Binary Tree to Linked List

#114 Flatten Binary Tree to Linked List 同步發佈於 Github repo 題目難度:Medium 題目敘述: Gi...