1
0
mirror of https://github.com/SunnyQjm/algorithm-review.git synced 2026-06-05 15:39:29 +08:00

Update 6_hot-potato.py

This commit is contained in:
2020-06-20 19:43:52 +08:00
committed by GitHub
parent c329bf9c8e
commit 041acb2d05
+1 -1
View File
@@ -38,7 +38,7 @@ class Solution:
思路:
1. 首先将所有人入队;
2. 将前num - 1个人出队,入队,则num个人处于队头位置,直接出队不入队
2. 然后将前num - 1个人出队,入队,则num个人处于队头位置,直接出队不入队;(这边说的前num - 1个人不一定都是不同的人,人少的时候可能绕一圈轮到同一个人)
3. 重复2,直至队列为空
"""
queue = Queue()