Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 63a290b

Browse files
Merge pull request #767 from SharingSource/ac_oier
✨feat: add 1823、2335、readme
2 parents 03046e3 + 756cc32 commit 63a290b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

‎LeetCode/1821-1830/1823. 找出游戏的获胜者(中等).md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ class Solution {
8686

8787
这还是一道约瑟夫环经典题。
8888

89+
> 另外一道同款题在 [这里](https://mp.weixin.qq.com/s?__biz=MzU4NDE3MTEyMA==&mid=2247490948&idx=1&sn=a71c4ec3529277ad119702d7dacf510e&chksm=fd9cb69bcaeb3f8d5461518a15d969b45a13558a4c5810100f40200a12aac66f1876f2ef6de7&token=831443013&lang=zh_CN#rd) 🎉🎉
90+
8991
每次往同一方向,以固定步长 $k$ 进行消数。由于下一次操作的发起点为消除位置的下一个点(即前后两次操作发起点在原序列下标中相差 $k$),同时问题规模会从 $n$ 变为 $n - 1,ドル因此原问题答案等价于 `findTheWinner(n - 1, k) + k`
9092

9193
一些细节,由于编号从 1ドル$ 开始,在返回答案时我们需要将结果为 0ドル$ 的值映射回编号 $n$。

‎LeetCode/2331-2340/2335. 装满杯子需要的最短总时长(简单).md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
这是 LeetCode 上的 **[2335. 装满杯子需要的最短总时长]()** ,难度为 **简单**
44

5-
Tag : 「递归」、「贪心」、「数学」、「排序
5+
Tag : 「排序」、「递归」、「模拟」、「贪心」、「数学
66

77

88

@@ -55,7 +55,7 @@ Tag : 「递归」、「贪心」、「数学」、「排序」
5555

5656
---
5757

58-
### 递归
58+
### 排序 + 递归
5959

6060
水的种类固定为 `3`,且每种水的数据范围只有 100ドル,ドル可直接使用递归进行求解。
6161

@@ -67,7 +67,7 @@ class Solution {
6767
public int fillCups(int[] amount) {
6868
Arrays.sort(amount);
6969
if (amount[1] == 0) return amount[2];
70-
amount[1]-=1; amount[2]-=1;
70+
amount[1]--; amount[2]--;
7171
return 1 + fillCups(amount);
7272
}
7373
}

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66

77
有任何问题欢迎你给我提 issue(issues 页有 [惊喜](https://github.com/SharingSource/LogicStack-LeetCode/issues/5)) 🤣
88

9-
![宫水三叶的刷题日记](https://oscimg.oschina.net/oscnet/up-19688dc1af05cf8bdea43b2a863038ab9e5.png)
9+
![宫水三叶的刷题日记](https://s1.ax1x.com/2023/06/25/pCN6HOJ.png)
10+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /