iT邦幫忙

鐵人檔案

2024 iThome 鐵人賽
回列表
佛心分享-刷題不只是刷題

刷題筆記 系列

刷題這條路,總是不進則退,每次懈怠後回頭看之前的刷題記錄,總是忘得一乾二淨,希望藉由參賽馬拉松鞭策自己刷題,同時也記錄自己的刷題過程,內容若有誤,再麻煩前輩高手們不吝指教!

參賽天數 19 天 | 共 19 篇文章 | 1 人訂閱 訂閱系列文 RSS系列文
DAY 1

在開跑前,先立個初衷

在刷題這條路上,我先從code war(https://www.codewars.com/)開始入門,一開始註冊的時候連function要怎麼寫都不會,還被上面...

DAY 2

[Day2] Pattern - Two Pointers

在最初開始刷題時,很多和陣列相關的題目讀完當下第一直覺便是使用雙層迴圈或是把符合條件的資料放進新的空陣列去解題,暴力、直覺、簡單。但隨著題目增加難度,發現有些題...

DAY 3

[Day3]Remove Duplicates from Sorted Array

Given an integer array nums sorted in non-decreasing order, remove the duplicat...

DAY 4

[Day4] Intersection of Two Arrays II

這一題其實以前就有寫過,只是當時還不知道Two Pointer的解題技巧,也是用迴圈粗暴解決,後來為了想要刻意練習使用Two Pointer技巧,又再重寫一次題...

DAY 5

[Day5]Fast and Slow Pointer & Floyd Cycle Detection Algorithm

今天延續上一個主題--雙指針,前面僅介紹了雙指針的左右指針,另外一種 -- 快慢指針,今天會搭配Floyd Cycle Detection Algorithm(...

DAY 6

[Day6] Happy Number

Write an algorithm to determine if a number n is happy.A happy number is a numb...

DAY 7

[Day7] Linked List Cycle II

Given the head of a linked list, return the node where the cycle begins. If the...

DAY 8

[Day8] Pattern - Sliding Window

Sliding Window是一種針對處理substring以及subarray的解題方法,可以減少時間複雜度,將O(n2)或O(n3)減至O(n)。 那麼Sl...

DAY 9

[Day9]Maximum Average Subarray I

You are given an integer array nums consisting of n elements, and an integer k....

DAY 10

[Day10] Fruit Into Baskets

You are visiting a farm that has a single row of fruit trees arranged from left...