題目: Given an integer array nums, return the third distinct maximum number in th...
題目: Given an integer array nums of length n and an integer target, find three i...
題目: Given an integer n, return true if it is a power of four. Otherwise, return...
本文同步刊載於 「為你自己學 Python - 字串的秘密生活(上)」 字串的秘密生活(上) 在大部份的程式語言裡,字串應該跟數字差不多都是最常用的資料型...
每天的專案會同步到 GitLab 上,可以前往 GitLab查看,有興趣的朋友歡迎留言 or 來信討論,我的信箱是 nickchen1998@gmail.com...
每天的專案會同步到 GitLab 上,可以前往 GitLab 查看,有興趣的朋友歡迎留言或來信討論,我的信箱是 nickchen1998@gmail.com。...
def get_instance_boxes_multisweep_sample_data(cls,...
題目: There is an integer array nums sorted in ascending order (with distinct val...
在開始正式使用一個程式語言進行程式編寫前,常常會聽到前輩們說:「設定環境大概就可以弄個半天一天了。」到底這邊指的環境是什麼?而為什麼環境會這麼令人頭痛複雜。 其...
本文同步刊載於 「為你自己學 Python - 浮點數之小數點漂移記」 浮點數之小數點漂移記 什麼是「浮點數」? 首先,你可曾想過這個問題,以前我們在數學...
HardRelated Topics: Hash Table / String / Greedy / Sorting / CountingLeetCode S...
今天來認識很酷的布林運算。 兩種 Boolean 運算子 and, or 其實在 Python 中的運作大相徑庭! 先來看看 or X or Y : 如果 X...
題目(6kyu): Write a program that will calculate the number of trailing zeros in a...
題目: Given a sorted array of distinct integers and a target value, return the in...
題目: Given an integer array nums sorted in non-decreasing order, remove the dupl...
開場白 筆者非本科系24歲,過去沒有上過正式程式課程的經驗。買了堂線上程式課後決定來寫codewars練習,參加鐵人賽紀錄我學習的日常,長期目標是未來能從0開始...
在正式開始之前記得在專案中創建虛擬環境,讓安裝的套件不會被互相影響,獨立的開發空間,是個良好的習慣。首先,先打開終端機,將路徑移動(cd)到要開發的文件夾下,輸...
在開始這篇的練習之前,可以先在 Django admin 的頁面上新增一些使用者、文章、留言、分類以及標籤。 以往想到 Django 篩選資料的套件,大部分第一...
今天我們要介紹 pydantic 在寫入資料時該如何與 MongoDB 互相搭配,下圖中是我們本次資料集的截圖 可以看到截圖當中我們的格式是固定的,紅色方框內...
題目: Given a binary tree, find its minimum depth. The minimum depth is the num...
今天我們要來教學基本的 Mongo 邏輯語法,同樣會用到之前插入的資料集以及資料模型,忘記模型的人可以參考這個連結 今天主要會教學的內容如下: $and 查詢...
MediumRelated Topics: Array / Prefix SumLeetCode Source 解題想法 這題我是看別人解法 原本以為要用...
題目: You are given a large integer represented as an integer array digits, where...
在 Mongodb 當中,提供了 aggregate 來讓我們進行複雜條件的查詢、計算,今天我們會利用 match、unwind 以及 group 來進行多對多...
浮點數到整數 今天繼續學習浮點數,我們常用的便是把浮點數轉換成點數,這種「轉換」總是會遺失一些資訊,因為小數點後面的位數不見了。 Python 有以下四種浮點數...
題目(6kyu): DESCRIPTION:Some numbers have funny properties. For example: 89 -->...
前情提要: 颱風都轉彎不來的時刻,當然是繼續開心碼農學習日常了! 這次還是做基本練習中的串列、元組和字典方面的練習,但課本有給學習評量的題目,但是卻沒給解答啊...
無檢查公告:作者於 10/4 出國,故 day19 以後程式碼都不會有當日檢查與修正,如果很要求程式正確性者,請於 10 月底再回來追喔! 小獅:真的要存明...
MediumRelated Topics: Math / String / SimulationLeetCode Source 解題想法 首先我們要定義分子...
題目(5kyu): What is an anagram? Well, two words are anagrams of each other if the...