Hash Table

1338. Reduce Array Size to The Half

1338. Reduce Array Size to The Half class Solution: def

244. Shortest Word Distance II

244. Shortest Word Distance II 參考: 243. Shortest Word Distance

243. Shortest Word Distance

243. Shortest Word Distance 這是一個非常適合面試的題目,暴力法求解的方式也很簡單如下: class Solution: def shortestDistance(

2342. Max Sum of a Pair With Equal Sum of Digits

2342. Max Sum of a Pair With Equal Sum of

2260. Minimum Consecutive Cards to Pick Up

2260. Minimum Consecutive Cards to Pick Up class Solution: def

2287. Rearrange Characters to Make Target String

2287. Rearrange Characters to Make Target String 同 1189. Maximum

1189. Maximum Number of Balloons

1189. Maximum Number of Balloons 這個題目其實很容易看得出來是用 Hash Table 來做,不過有一個小地方是要怎麼處理

1133. Largest Unique Number

1133. Largest Unique Number class Solution: def largestUniqueNumber(self, nums:

2225. Find Players With Zero or One Losses

2225. Find Players With Zero or One Losses class Solution:

2336. Smallest Number in Infinite Set

2336. Smallest Number in Infinite Set 這個題目滿有趣的,側重在邏輯處理的部分,寫 code