LeetCode Biweekly Contest 48 Editorial
2021/03/20
LeetCode
![](/static/da3e43f88e898f3724bbb7a137a05ec3/ea12a/lc_contest.png)
Q1: Second Largest Digit in a String
應該沒什麼難度只是看哪個實作方法比較快,我是用排序的 tree set 方便找到倒數第二個數。
Time Complexity:
Space Complexity: ,
> Read more
A year of LeetCode
2021/03/16
LeetCode
![](/static/e8fb92d73df6cf8f71d774fa294a5462/1e1e8/2021-03-16_13-33-06-firefox.png)
中間那塊灰色請自行在腦中用迷彩補上。
Origin
應該也在 FB 分享過了,2020 年 3 月實驗室同學百謙跟霸ㄅ在準備碩論的同時也開始在為找工作練習寫 LeetCode 題目,雖然我很雖小要當兵沒辦法畢業就接軌工作,但看他們開始寫我自己也是有點求職焦慮,感覺不寫到時候可能找工作會有問題,就在某天上午下定決心辦帳號寫了第一題 Two Sum。
Strategy
一開始按照編號開始寫,到第四題 Median of Two Sorted Array 卡住就覺得好像不應該用這種順序寫,後來就改成寫 Top 100 Liked Questions…
> Read more
LeetCode Weekly Contest 232 Editorial
2021/03/14
LeetCode
![](/static/da3e43f88e898f3724bbb7a137a05ec3/ea12a/lc_contest.png)
Q1: Check if One String Swap Can Make Strings Equal
先比對是不是不用做任何操作,接著從左往右掃,找到兩個不同字母的位置就互換然後終止掃描來做判斷。
Time Complexity:
Space Complexity:
> Read more
LeetCode Weekly Contest 231 Editorial
2021/03/07
LeetCode
![](/static/da3e43f88e898f3724bbb7a137a05ec3/ea12a/lc_contest.png)
Q1: Check if Binary String Has at Most One Segment of Ones
從左往右掃,用一個boolean
紀錄遇到了沒,如果遇到的時候發現之前已經遇到就回傳false
。
Time Complexity:
Space Complexity:
> Read more
LeetCode Biweekly Contest 47 Editorial
2021/03/06
LeetCode
![](/static/da3e43f88e898f3724bbb7a137a05ec3/ea12a/lc_contest.png)
Q1: Find Nearest Point That Has the Same X or Y Coordinate
掃過一次、每次找到符合條件的對象時對答案進行更新即可。
Time Complexity:
Space Complexity:
> Read more
LeetCode Weekly Contest 230 Editorial
2021/03/03
LeetCode
![](/static/da3e43f88e898f3724bbb7a137a05ec3/ea12a/lc_contest.png)
> Read more