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 readBookmarks3 min read
Sep 11, 2022Leetcode — 10. Regular Expression Matching (中文)問題連結: https://leetcode.com/problems/regular-expression-matching/ 回傳給予的字串 (s) 是否可成功對應 使用了 '.' 和'*' 的正規表達式regular expression 的模板字串 (p): '.' 可對應任何字元 '*' 對應0或多個在這之前的某字元 且套用需整個字串可以套用在整個模板 …8 min read8 min read
Sep 11, 2022Leetcode — 10. Regular Expression MatchingThe link to the problem: https://leetcode.com/problems/regular-expression-matching/ Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). …7 min read7 min read
Feb 23, 2021Leetcode — 739. Daily Temperatures (中文)問題連結: https://leetcode.com/problems/daily-temperatures/ 給予一陣列T代表每天的溫度, 請回傳一個陣列紀錄當我們在某天的時候, 最快要幾天才能碰到比當天還溫暖的天氣, 若未來沒有任何一天會比當天還溫暖, 則就設要0天才能碰到 限制: 溫度陣列長度會介於 [1, 30000]之間 各溫度的範圍會介於[ …Leetcode6 min readLeetcode6 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 readLeetcode5 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 readLeetcode12 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 readLeetcode9 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 readLeetcode8 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 readLeetcode5 min read
Feb 8, 2021Leetcode — 980. Unique Paths III (中文)問題連結: https://leetcode.com/problems/unique-paths-iii/ 在一個二維整數矩陣grid, 每個格子有可能為四種不同的形態: 1 代表這格是我們的起點位置, 整個矩陣中只會有一個起點 2 代表我們要走到的終點位置, 整個矩陣中只會有一個終點 0 代表我們可以走的格子 -1 有障礙在這格上面, 我們不可穿越 當我們在各格 …Leetcode7 min readLeetcode7 min read