You are given a string s and an integer k. You can choose any character of the s...
Given a string s, find the length of the longest substring without repeating cha...
Given two strings s and t, return true if t is an anagram of s, and false otherw...
Given an integer array nums, return true if any value appears at least twice in...
歐氏定理: 「英文文法跟中文相反」。以下這一段英文,最重要的是在「最後面」(choose an element of the array and increme...
前言 這題標準運用了二分搜尋法,演算法通常需要使用二分思想,即每次能夠排除一半的範圍,快速的找出陣列中所要求的元素位置,這樣時間複雜度可達 O(log n)...
MediumRelated Topics: Hash Table / Math / StringLeetCode Source 解題想法 LeetCode...
歐氏定理: 「英文文法跟中文是相反的。」Return true if s is an acronym of words, and false otherwise...
HardRelated Topics: Array / Two Pointers / Dynamic Programming / Stack / Monoto...
前言 這題是一題動態規劃問題,目標是擷取不連續的元素,全部相加起來選出最優解,因只用了一層迴圈,時間複雜度可估 O(n),這裡有 JAVA 和 Python...
HardRelated Topics: Array / GreedyLeetCode Source 解題想法 首先先確認 len(ratings),如果小於...
MediumRelated Topics: Array / GreedyLeetCode Source 解題想法 這題是看之前解的方法 Python cl...
MediumRelated Topics: Array / Prefix SumLeetCode Source 解題想法 這題我是看別人解法 原本以為要用...
MediumRelated Topics: Array / Hash Table / Math / Design / RandomizedLeetCode S...
MediumRelated Topics: Array / Sorting / Counting SortLeetCode Source 解題想法 這題我卡...
MediumRelated Topics: Array / Dynamic Programming / GreedyLeetCode Source 解題想法...
MediumRelated Topics: Array / Dynamic Programming / GreedyLeetCode Source 解題想法...
MediumRelated Topics: Array / Dynamic Programming / GreedyLeetCode Source 解題想法...
EasyRelated Topics: Array / Dynamic ProgrammingLeetCode Source 解題想法 當下想到最直覺的解法...
碎碎念 好幾天沒寫文了,但其實每天都有上去看題(例如昨天的螞蟻相撞),也都有在跟朋友討論。這幾天有很多可以用外鄉人作法來處理的題目,感覺是蠻有趣的。 題幹 給一...
MediumRelated Topics: Array / Math / Two PointersLeetCode Source 解題想法 這裡初始化 l...
EasyRelated Topics: Array / Hash Table / Divide and Conquer / Sorting / Countin...
MediumRelated Topics: Array / Two PointersLeetCode Source 解題想法 這題跟昨天類似,但可重複的數字...
EasyRelated Topics: Array / Two PointersLeetCode Source 解題想法 這題有 Hint 我有看一下 XD...
EasyRelated Topics: Array / Two PointersLeetCode Source 解題想法 題目除了要回傳最後 nums 的長...
碎碎念 好像斷更了,但沒關係,跟我一起挑戰的朋友有持續下去的樣子。今天也是一個跟閱讀測驗鬥智鬥勇的題目,而且最後搞出來的程式碼大概40行你真的是easy題目嗎....
EasyRelated Topics: Array / Two Pointers / SortingLeetCode Source 解題想法 題目要求要 i...
碎碎念 大腦不夠用了,看了答案也還沒辦法吸收,我沒有提交,這禮拜我應該少交了兩三個,都好難ㄛ哭 題幹 用最少的豬來測試毒水桶,有點像是去找哪個硬幣比較輕的腦筋急...
前言 這題有點類似 Prefix Sums 的概念,目標是找到陣列中元素自己以外的所有元素的乘績,放在一個新的陣列裡,雖然有三個迴圈是 O(3n) 的時間複...
碎碎念 AI已經強大到我覺得「他已經知道我在刷leetcode」了......可能我問問題的時候直接讓他知道我是要看母音吧 是說,我很想知道到底是誰在看我的文章...