PinnedBookmarks for this BlogI’m new to Medium and I didn’t see any features that can show all my stories in a list. Hence, I created this story to include all the links to each story in case someone wants to find certain stories. You can just use ctrl+F to search the keyword on…Bookmarks3 min read
Feb 23, 2021Leetcode — 739. Daily Temperatures (中文)問題連結: https://leetcode.com/problems/daily-temperatures/ 給予一陣列T代表每天的溫度, 請回傳一個陣列紀錄當我們在某天的時候, 最快要幾天才能碰到比當天還溫暖的天氣, 若未來沒有任何一天會比當天還溫暖, 則就設要0天才能碰到 限制: 溫度陣列長度會介於 [1, 30000]之間 各溫度的範圍會介於[ …Leetcode6 min read
Feb 23, 2021Leetcode — 739. Daily TemperaturesThe link to the problem: https://leetcode.com/problems/daily-temperatures/ Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. …Leetcode5 min read
Feb 20, 2021Leetcode — 1035. Uncrossed Lines (中文)問題連結: https://leetcode.com/problems/uncrossed-lines/ 我們有兩個整數陣列A和B, 我們按照整數數字在陣列裡面的順序, 把裡面的數字列成兩排, 屬於A陣列的一排, 屬於B的另一排 若滿足以下條件的話, 我們想要畫線把數字A[i]和B[j]連在一起: A[i] == B[j]; 當我們從A的某數連到 …Leetcode12 min read
Feb 15, 2021Leetcode — 1035. Uncrossed LinesThe link to the problem: https://leetcode.com/problems/uncrossed-lines/ We write the integers of A and B (in the order they are given) on two separate horizontal lines. Now, we may draw connecting lines: a straight line connecting two numbers A[i] and B[j] such that: A[i] == B[j]; The line we draw does…Leetcode9 min read
Feb 14, 2021Leetcode — 5. Longest Palindromic Substring (中文)問題連結: https://leetcode.com/problems/longest-palindromic-substring/ 給予一字串 s, 回傳在 s中可找到最長的回文子字串 範例 Input: s = "babad" Output: "bab" -> 因s字串中, 最長可組成的回文子字串長度是3, 答案回傳"aba"也算對 想法: 先來講回文的定義, …Leetcode8 min read
Feb 13, 2021Leetcode — 5. Longest Palindromic SubstringThe link to the problem: https://leetcode.com/problems/longest-palindromic-substring/ Given a string s, return the longest palindromic substring in s. Example Input: s = "babad" Output: "bab" Note: "aba" is also a valid answer. Thoughts: The definition of a palindrome is a word that reads the same backward as forward. Hence, there are two…Leetcode5 min read
Feb 8, 2021Leetcode — 980. Unique Paths III (中文)問題連結: https://leetcode.com/problems/unique-paths-iii/ 在一個二維整數矩陣grid, 每個格子有可能為四種不同的形態: 1 代表這格是我們的起點位置, 整個矩陣中只會有一個起點 2 代表我們要走到的終點位置, 整個矩陣中只會有一個終點 0 代表我們可以走的格子 -1 有障礙在這格上面, 我們不可穿越 當我們在各格 …Leetcode7 min read
Feb 8, 2021Leetcode — 980. Unique Paths IIIThe link to the problem: https://leetcode.com/problems/unique-paths-iii/ On a 2-dimensional grid, there are 4 types of squares: 1 represents the starting square. There is exactly one starting square. 2 represents the ending square. There is exactly one ending square. 0 represents empty squares we can walk over. -1 represents obstacles that…Leetcode4 min read
Feb 8, 2021Leetcode — 904. Fruit Into Baskets (中文)問題連結: https://leetcode.com/problems/fruit-into-baskets/ In a row of trees, the i-th tree produces fruit with type tree[i]. You start at any tree of your choice, then repeatedl …Leetcode7 min read