iT邦幫忙

leetcode相關文章
共有 1104 則文章

技術 leetcode with python:9. Palindrome Number

題目: Given an integer x, return true if x is palindrome integer.An integer is a...

技術 leetcode with python:1. Two Sum

從今天起在此紀錄用python寫leetcode的心路歷程希望能以一天兩三題的速率下去更新讓自己的程式更加精進 題目: Given an array of i...

技術 Day 6, Leetcode problem 1: Two Sum, C++

逃避雖可恥,但有用。但這句話恐怕在我身上行不通。每一次當我遇到問題時,我只有兩種選擇: 逃避它(消耗能量: 0 ) 面對處理它(消耗能量: ∞ max )...

技術 Leetcode (Algorithm I): 5. Search Insert Position

思路 也是binary search的應用題,承前兩篇文章,有lb跟ub和index三個數值可選,我目前覺得應該是回傳lower bound值。    程式 c...

技術 Leetcode: 278. First Bad Version

思路 呼叫API的次數越少越好,因為不確定錯誤會是在前面一點的版本出現,還是後面一點的版本出現,因此最好從中間的版本切入,如果該版本回傳結果為有錯誤的版本,則繼...

技術 LeetCode 955. Delete Columns to Make Sorted II

Delete Columns to Make Sorted II Medium You are given an array of n strings...

技術 LeetCode 6. Zigzag Conversion

Zigzag Conversion Medium The string "PAYPALISHIRING" is written in...

鐵人賽 Software Development DAY 30

技術 Day 30:結束後的下一步

回顧 & 總結 今天是最後一天了,來回顧一下這些日子分享及學習的內容,雖然是寫LeetCode的題目為主,但在過程中每天的題目是有選過主題的,一天一天都...

鐵人賽 Software Development DAY 29

技術 Day 29:653. Two Sum IV - Input is a BST

今日題目 題目連結:653. Two Sum IV - Input is a BST 題目主題:Hash Table, Two Pointers, Tree,...

鐵人賽 Software Development DAY 29

技術 [29] 用 python 刷 Leetcode: 404

原始題目 Given the root of a binary tree, return the sum of all left leaves. Example...

鐵人賽 Software Development DAY 28

技術 [28] 用 python 刷 Leetcode: 1013

原始題目 Given an array of integers arr, return true if we can partition the array i...

鐵人賽 Software Development DAY 28

技術 Day 28:1. Two Sum

今日題目 題目連結:1. Two Sum 題目主題:Array, Hash Table 簡單說說 Hash Table Hash Table 主要的核心概念是...

鐵人賽 Software Development DAY 27

技術 [27] 用 python 刷 Leetcode: 455

原始題目 Assume you are an awesome parent and want to give your children some cookie...

鐵人賽 Software Development DAY 26

技術 [26] 用 python 刷 Leetcode: 150 evaluate reverse polish notatio

原始題目 Evaluate the value of an arithmetic expression in Reverse Polish Notation....

鐵人賽 Software Development DAY 26

技術 Day 26:53. Maximum Subarray (2)

今日題目 題目連結:53. Maximum Subarray 題目主題:Array, Divide and Conquer, Dynamic Programmi...

鐵人賽 Software Development DAY 25

技術 Day 25:53. Maximum Subarray (1)

今日題目 題目連結:53. Maximum Subarray 題目主題:Array, Divide and Conquer, Dynamic Programmi...

鐵人賽 Software Development DAY 25

技術 [25] 用 python 刷 Leetcode: 155 min-stack

原始題目 Design a stack that supports push, pop, top, and retrieving the minimum ele...

鐵人賽 Software Development DAY 24

技術 [24] 用 python 刷 Leetcode: 66 plus-one

原始題目 You are given a large integer represented as an integer array digits, where...

鐵人賽 Software Development DAY 24

技術 Day 24:605. Can Place Flowers

今日題目 題目連結:605. Can Place Flowers 題目主題:Array, Greedy 昨天介紹了 Greedy 的基本概念,今天會在練習一題以...

鐵人賽 Software Development DAY 23

技術 [23] 用 python 刷 Leetcode: 290 Word Pattern

因為我對 python 不熟,題目可能會在簡單和中等之間跳來跳去 用 Python3 解 LeetCode 系列,290 Word Pattern,屬於 Eas...

鐵人賽 Software Development DAY 22

技術 Day 22 :Validate BST

今天直接動手來解題吧!我們從根(root)開始,利用Divide and Conquer來驗證每一個子樹(Subtree),直到我們驗證到最後的葉子。 像是我們...

鐵人賽 Software Development DAY 22

技術 Day 22:1863. Sum of All Subset XOR Totals

今日題目 題目連結:1863. Sum of All Subset XOR Totals 題目主題:Array, Backtracking, Bit Manip...

鐵人賽 Software Development DAY 21

技術 Day 21 :廣度優先搜尋 Breadth-First search(BFS)

說到廣度優先搜尋我一定要現知道Queue Queue(佇列)是先進來的元素先出去(First In First Out = FIFO)的資料結構,通常用於讓程...

鐵人賽 Software Development DAY 21

技術 Day 21:401. Binary Watch

今日題目 題目連結:401. Binary Watch 題目主題:Backtracking, Bit Manipulation 簡單說說 Backtracki...

鐵人賽 Software Development DAY 20

技術 Day 20 : 深度追蹤 Depth-first-searh

深度追蹤是刷題前一定要了解的觀念!今天就來用Depth-first-searh的方式來走訪一棵樹吧! 其實從名稱上看起來很直覺,簡單來說就是當我們走了一條路,前...

鐵人賽 Software Development DAY 20

技術 Day 20:1566. Detect Pattern of Length M Repeated K or More Times

今日題目 題目連結:1566. Detect Pattern of Length M Repeated K or More Times 題目主題:Array,...

鐵人賽 Software Development DAY 19

技術 Day 19:二元樹遍歷 Binary Tree Traversal

今天一起來認識二元樹的三種遍歷方式吧!但是別急!我們先來認識二元搜尋樹BST的定義! 二元搜尋樹是一棵二元樹,如果不為空(二元樹可以為空!)則須滿足: 左子樹...

鐵人賽 Software Development DAY 19

技術 Day 19:1534. Count Good Triplets

今日題目 題目連結:1534. Count Good Triplets 題目主題:Array, Enumeration 分享完Binary Tree等等相關主題...

鐵人賽 Software Development DAY 18

技術 Day 18 : 二分搜尋 Binary Search

生活上我們可能有遇過一些二分搜尋的例子。例如以前如果有當過助教的經驗,有時候我們在收學生作業時會作業按照學號由小到大排好,假設有100位學生001~100,我們...

鐵人賽 Software Development DAY 17

技術 Day 17 : Add Two Numbers

這一題題目會給我們兩個Linked Lists,分別代表兩個非負整數。題目要我們把兩個數相加後回傳一個新的Linked Lists來代表相加後的和。 題目有說,...