MediumRelated Topics: Math / String / SimulationLeetCode Source 解題想法 首先我們要定義分子...
題目: Given a string s which consists of lowercase or uppercase letters, return t...
在實作上傳檔案的功能之前,我們先幫文章模型加上封面圖片的欄位: # server/app/blog/models.py # ... 省略 class Post(...
5. Longest Palindromic Substring Question Given a string s, return the longest p...
題目: You are climbing a staircase. It takes n steps to reach the top. Each tim...
前天我們解釋了一些常用的邏輯閘,例如:and、or 等等,我們也學到了可以把多個條件同時放進這些邏輯閘中的 list,然而當今天你只想針對同個欄位做多個數值的判...
題目(5kyu): Given an array of numbers, calculate the largest sum of all possible...
今天我們要來教學該如何進行基本的資料查詢,同樣會用到之前插入的資料集以及資料模型,忘記模型的人可以參考 這個連結 今天主要會教學的內容如下: 查找單筆資料 查...
題目: An ugly number is a positive integer whose prime factors are limited to 2,...
EasyRelated Topics: Array / Dynamic ProgrammingLeetCode Source 解題想法 當下想到最直覺的解法...
本文同步刊載於 「為你自己學 Python - 轉呀轉呀七彩迭代器)」 轉呀轉呀七彩迭代器 在 Python 裡迭代器(Iterator)使用的頻率很高,...
本文同步刊載於 「為你自己學 Python - 不動如山的 Tuple」 不動如山的 Tuple Python 裡的 Tuple 是一種不可變的(Immu...
題目: Given two strings needle and haystack, return the index of the first occurr...
Relay 是一種使用 GraphQL 的規範,其名稱來自於由 Facebook 開發的 JavaScript 框架 Relay。這種規範規定了一些特定的慣用格...
題目: Given a positive integer num, write a function which returns True if num is...
HardRelated Topics: Graph / Heap (Priority Queue) / Shortest PathLeetCode Sourc...
接續昨天 unpacking 的學習,今天我們來練習更進階的 unpacking。 假設我們現在分別要得到一個陣列的首位元素和剩餘元素,可能會這樣寫: l =...
今天要介紹的是 expr,他可以讓我們在不使用 aggregate 的情況下進行一些簡易的表達式操作,節省我們編寫程式碼的時間 語法:{ $expr: {...
MediumRelated Topics: Array / Dynamic Programming / GreedyLeetCode Source 解題想法...
排序 在新增資料排序的功能之前,先新增一個 Python 檔: $ touch server/app/blog/graph/orders.py 接著編輯ser...
每天的專案會同步到 GitLab 上,可以前往 GitLab 查看,有興趣的朋友歡迎留言 or 來信討論,我的信箱是 nickchen1998@gmail.co...
MediumRelated Topics: Array / Sliding WindowLeetCode Source 解題想法 我們首先遍歷數組來計算1的...
在前面我們透過 Strawberry 將 GraphQL 一些最基礎的概念練習一遍了(https://graphql.org/learn/ 上,最佳實踐以外的內...
MediumRelated Topics: Array / Matrix / SimulationLeetCode Source 解題想法 首先設定每次尋訪...
今天我們來研究 Booleans(布林值)。 Python 內建有 bool class 表達布林值,這個 class 是從 int class 繼承而來: i...
本文同步刊載於 「為你自己學 Python - 物件生成全紀錄」 物件生成全紀錄 class Cat: pass kitty = Cat()...
在 MongoDB 中,您可以使用 pymongo 建立使用者並分配相關權限。以下是一個使用 pymongo 建立使用者和分配權限的範例: import pym...
本文同步刊載於 「為你自己學 Python - 類別與它們的產地)」 類別與它們的產地 大家講到物件導向程式設計,大概就會講到類別(Class)這個東西。...
小獅:誒都,不是啊,這樣我們是不是也是要在使用者給予密碼以前,要先給前端鹽巴以及 HASH 次數,不然前端怎麼做 老獅:對的,當使用者輸入帳號以後,我們應該先給...
今天我們要來介紹 MongoDB 在 7.0 版本以後新推出的資料庫遷移工具,他可以協助我們把關聯式資料庫的資料無痛遷移到 MongoDB 當中,讓我們不需要煩...