Leetcode

含有「Leetcode」共 39 篇內容
全部內容
發佈日期由新至舊
5. Longest Palindromic Substring Given a string s, return the longest palindromic substring in s. 這個問題是要求你在一個給定的字串 s 中,找出最長的、連續的、且是一個回文的子字串。 Exampl
Thumbnail
黎星羽-avatar-img
2025/12/01
中心擴展法真的很直覺又高效! 看完範例,回文子字串瞬間搞懂了。 感謝分享,筆記起來超實用!
✨ 1. 題目說明(白話翻譯) 題目原文: Given a string s, find the length of the longest substring without duplicate characters. 白話解釋如下: ✔ substring(子字串) 必須是 連續 的字
Thumbnail
1. Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume
Thumbnail
最近感覺有點瓶頸的感覺,來練習Leetcode並做筆記記錄下來。 128. Longest Consecutive Sequence Given an unsorted array of integers nums, return the length of the longest consec
加油!
題目概述 LeetCode 第 1174 題「Immediate Food Delivery II」的目標是計算所有顧客的第一筆訂單中,即時配送(即訂單日期與顧客偏好配送日期相同)的比例,並將結果四捨五入至小數點後兩位。 [問題連結]
Thumbnail
此文章介紹LeetCode中Binary Tree的三種主要遍歷方法:深度優先搜尋(DFS)、廣度優先搜尋(BFS)和中序遍歷(Inorder Traversal),並搭配LeetCode範例題目說明其應用與解題技巧。文末總結各種方法的適用情境,幫助讀者提升解題能力。
Thumbnail
自 2019-07-27 開始,往前推 30 天 ,計算每天的活躍用戶數。用戶在某天如果至少有一次活動記錄,則被認為在該天是活躍的,不用管答案的排序。
Thumbnail
◆ 句子(sentence)的定義:小寫字母拼成的單字所組成的字串,每個單字間由單一個空白字元進行分隔。 ◆ uncommon的定義:在單一句子內只出現一次,並且沒有出現在另外一句中。 ◆ 給兩個句子s1跟s2,回傳所有符合uncommon定義的單字,可以為任意順序。
Thumbnail
題目 : 121. Best Time to Buy and Sell Stock
Thumbnail
小松鼠-avatar-img
2024/02/13
Welcome back, Youna新年快樂~
Youna-avatar-img
發文者
2024/02/18
小松鼠 新年快樂! 最近因為剛入職所以很少更新XD