Skip to content

Commit eb0af71

Browse files
committed
chore: folder명 날짜수정
1 parent f61ead1 commit eb0af71

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
def solution(n, stations, w):
2-
answer = 0
3-
width = w * 2 + 1
4-
prev_loc = 0
5-
for station in stations:
6-
left, right = station - w, station + w
7-
cur_loc = left - prev_loc - 1
8-
q, r = divmod(cur_loc, width)
9-
answer += count(q,r)
10-
if right > n:
11-
right = n
12-
prev_loc = right
13-
if prev_loc < n:
14-
q, r = divmod(n - prev_loc, width)
15-
answer += count(q, r)
16-
return answer
17-
18-
def count(q, r):
19-
if r:
20-
return q + 1
21-
else:
1+
def solution(n, stations, w):
2+
answer = 0
3+
width = w * 2 + 1
4+
prev_loc = 0
5+
for station in stations:
6+
left, right = station - w, station + w
7+
cur_loc = left - prev_loc - 1
8+
q, r = divmod(cur_loc, width)
9+
answer += count(q,r)
10+
if right > n:
11+
right = n
12+
prev_loc = right
13+
if prev_loc < n:
14+
q, r = divmod(n - prev_loc, width)
15+
answer += count(q, r)
16+
return answer
17+
18+
def count(q, r):
19+
if r:
20+
return q + 1
21+
else:
2222
return q
File renamed without changes.

0 commit comments

Comments
 (0)