Given a linked list, swap every two adjacent nodes and return its head.
【LeetCode】0021. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
【LeetCode】0019. Remove Nth Node From End of List
Given a linked list, remove the n-th node from the end of list and return its head.
【LeetCode】0018. 4Sum
Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
【CodiMD】docker-compose 備份
這是 安裝完 CodiMD 後在執行定期備份時踩到的坑…在使用 crontab + script 定期備份時,我百思不得其解,為啥我跑出來的 backup.sql 會是空的? 更讓我不解的是,我手動執行 script 的結果卻是正常的!???
【Shell Script】使用 crontab + script 定期備份並保留30天
這是 CodiMD 安裝的後續…,雖然跟 CodiMD 沒啥關係 XD 這次的主要目的是為 CodiMD 做一個定期備份,另外為了儲存空間上的考量,備份檔案只保留 30 天,一旦超過就刪除資料。
【Shell Script】if ... else 條件判斷式
Shell Script 的條件宣告是用 [] ,if 條件後面需接 then ,block 結束後接 fi
【Shell Script】檢查檔案是否為空白
在寫 Shell Script 時 ,想確定某檔案是否為空,若為空則想執行其他動作。
【LeetCode】0017. Letter Combinations of a Phone Number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.
【LeetCode】0016. 3Sum Closest
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.