今天是紀錄LeetCode解題的第十四天 第十四題題目:Write a function to find the longest common prefix s...
今天是紀錄LeetCode解題的第十三天 第十三題題目:Given a roman numeral, convert it to an integer.For...
今天是紀錄LeetCode解題的第十二天 第十二題題目:Given an integer, convert it to a Roman numeral.Roma...
今天是紀錄LeetCode解題的第十一天 第十一題題目:You are given an integer array height of length n. F...
今天是紀錄LeetCode解題的第九天是很簡單的一題題目 第九題題目:Given an integer x, return true if x is a pal...
今天是紀錄LeetCode解題的第八天 第八題題目:Implement the myAtoi(string s) function, which convert...
今天是紀錄LeetCode解題的第七天 第七題題目:Given a signed 32-bit integer x, return x with its dig...
今天是紀錄LeetCode解題的第十天來看前十題當中的第二題困難題 第十題題目:Given an input string s and a pattern p,...
今天是紀錄LeetCode解題的第六天 第六題題目:給一個字串假設是"PAYPALISHIRING",把它以Z字形排列輸出成"PA...
今天是紀錄LeetCode解題的第五天 第五題題目:Given a string s, return the longest palindromic subst...
今天是紀錄LeetCode解題的第四天來看一題困難題 第四題題目:Given two sorted arrays nums1 and nums2 of size...
今天是紀錄LeetCode解題的第三天 第三題題目:Given a string s, find the length of the longest subst...
今天是紀錄LeetCode解題的第二天 第二題題目:given two non-empty linked lists representing two non-...
說實話這題我搞超久的,主要就是卡在時間複雜度的問題,因為題目有規定時間複雜度要壓縮到O(log(m+n))一般的合併方法時間複雜度是 O(m+n),但這需要用二...
Given an unsorted integer array nums. Return the smallest positive integer that...
Winter is coming! During the contest, your first job is to design a standard he...
Given a sorted array of distinct integers and a target value, return the index...
You are given an array of k linked-lists lists, each linked-list is sorted in a...
You are given an integer array nums consisting of n elements, and an integer k....
Given the head of a linked list, return the node where the cycle begins. If the...
這一題其實以前就有寫過,只是當時還不知道Two Pointer的解題技巧,也是用迴圈粗暴解決,後來為了想要刻意練習使用Two Pointer技巧,又再重寫一次題...
有時Leetcode 沒考過,不是考生的問題: 是出題的人有問題。 ========= 以下以Leetcode 1656. Design an Ordered...
以下以 Leetcode 657. Robot Return to Origin 為例子,程式的解答只有十行程式碼,其實大部份的程式人員都寫的出來,但是,程式...
碎碎念 好幾天沒寫文了,但其實每天都有上去看題(例如昨天的螞蟻相撞),也都有在跟朋友討論。這幾天有很多可以用外鄉人作法來處理的題目,感覺是蠻有趣的。 題幹 給一...
碎碎念 好像斷更了,但沒關係,跟我一起挑戰的朋友有持續下去的樣子。今天也是一個跟閱讀測驗鬥智鬥勇的題目,而且最後搞出來的程式碼大概40行你真的是easy題目嗎....
碎碎念 大腦不夠用了,看了答案也還沒辦法吸收,我沒有提交,這禮拜我應該少交了兩三個,都好難ㄛ哭 題幹 用最少的豬來測試毒水桶,有點像是去找哪個硬幣比較輕的腦筋急...
碎碎念 AI已經強大到我覺得「他已經知道我在刷leetcode」了......可能我問問題的時候直接讓他知道我是要看母音吧 是說,我很想知道到底是誰在看我的文章...
碎碎念 這題我沒做出來,還碰到了GPT4的發問上限,相當崩潰我個人是非常賭爛這一題的,題目描述很空泛(討論區也有在罵的,所以看來不是只有我) 題幹 我自己也不是...
碎碎念 這是一個很棒的題目,也是我所期待遇到的東西。當然,也不排除是我太笨啦。 題幹 給予兩個數值,第一個k代表會有幾階的數,一階是0,二階是把0變成01,三階...
碎碎念 這應該是一兩天前的,但因為那幾天忙碌就沒有記下來了。這一題可難可簡單,我是先用了笨方法然後吃到超時,然後請GPT改成快一點的方法(蠻猛的) 提案 這題也...