Skip to content

Commit 2c44849

Browse files
committed
tidy code
1 parent 3d575f7 commit 2c44849

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Queue/hot_potato/hot_potato.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
# Created by imoyao at 2019/6/10 18:34
4-
import pathlib
5-
import sys
64

7-
util_p = pathlib.Path('../').resolve()
8-
sys.path.append(str(util_p))
9-
from queue import Queue
105

6+
from Queue.queue import Queue
117

12-
def hot_potato(name_lists, num): # TODO:待验证
8+
9+
def hot_potato(name_lists, num): # TODO:待验证
1310
"""
1411
假设拿着土豆的孩子位于队首,当开始传递土豆时,模拟器会将那个孩子从队首移出队列然后立即让他从队尾进入队列。所有在他前面的人都
1512
轮过一遍后才会再次轮到他传土豆。每经过'num'次出队入队的过程后,站在队首的孩子就会永久离开队列,游戏将在新的圆圈中继续进行。

0 commit comments

Comments
 (0)