https://leetcode.com/problems/merge-intervals/
It means each list in intervals is a range, just to merge the overlapping one, others stay the same.
https://leetcode.com/problems/merge-intervals/
It means each list in intervals is a range, just to merge the overlapping one, others stay the same.
Given two 0-indexed integer arrays nums1 and nums2, return a list answer of size 2 where:
- answer[0] is a list of all distinct integers in nums1 which are not present in nums2.
- answer[1] is a list of all distinct integers in nums2 which are not present in nums1.
Note that the integers in the lists may be returned in any order.
1 | class Solution: |
https://leetcode.com/problems/sign-of-the-product-of-an-array/
There is a function signFunc(x) that returns:
1 if x is positive.
-1 if x is negative.
0 if x is equal to 0.
You are given an integer array nums. Let product be the product of all values in the array nums.
Return signFunc(product).
1 | class Solution: |
https://leetcode.com/problems/average-salary-excluding-the-minimum-and-maximum-salary/
You are given an array of unique integers salary where salary[i] is the salary of the ith employee.
Return the average salary of employees excluding the minimum and maximum salary. Answers within 10-5 of the actual answer will be accepted.
1 | class Solution: |
1 | def average(self, salary: List[int]) -> float: |
1 | def average(self, salary: List[int]) -> float: |
1 | def average(self, salary: List[int]) -> float: |
換電腦後發現即使有用 time machine 做備份還是要重新部署
因為 push 至 github 的是已經編譯過後的檔案,所以沒有留原始檔的話,看起來應該沒救了(?)
check.io 上的題目:合格的密碼須含數字
此系列文章主要是自己在解題時覺得有趣的題目,記錄下來讓自己以後方便複習,有興趣的人可以參考看看
check.io 上的題目:將字串轉成規定的格式
此系列文章主要是自己在解題時覺得有趣的題目,記錄下來讓自己以後方便複習,有興趣的人可以參考看看
check.io 上的題目:判斷西洋棋中的兵有幾個是安全的
此系列文章主要是自己在解題時覺得有趣的題目,記錄下來讓自己以後好複習,有興趣的人可以參考看看
總結來說:兵的行徑方向走斜對角的(左前、右前),若是兵的右下或左下有其他兵的話,他就是安全的
1 | def safe_pawns(pawns: set) -> int: |
HackerRank 上的題目:找出成對的襪子並算出總共有幾雙
此系列文章主要是自己在解題時覺得有趣的題目,記錄下來讓自己以後好複習,有興趣的人可以參考看看
實習開發網站,常遇到一些功能需求要上網查詢,整理成筆記以後再用到就不用又從頭開始找,也希望幫助到正在找學這些功能的人