Skip to content

Commit 77652c8

Browse files
authored
Merge pull request #243 from AlgorithmStudy-Allumbus/hongjoo
Hongjoo/7์›”5์ฃผ์ฐจ/5๋ฌธ์ œ
2 parents 74d2ed8 + 7bdf288 commit 77652c8

9 files changed

+377
-30
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
๋งํฌ : https://school.programmers.co.kr/learn/courses/30/lessons/12953
3+
4+
n๊ฐœ์˜ ์ˆซ์ž๋“ค์˜ ์ตœ์†Œ ๊ณต๋ฐฐ์ˆ˜
5+
Inspect :n ๊ฐœ์˜ ์ˆซ์ž๋“ค์ด ๋ชจ๋‘ "1" ์ด ๋  ๋•Œ ๊นŒ์ง€ 2~100์˜ ์ž์—ฐ์ˆ˜๋“ค์˜ ๊ฐ’์œผ๋กœ ๋‚˜๋ˆ„๊ธฐ
6+
ex)
7+
[2,6,8,14]
8+
e = 2 : [1,3,4,7] => elements = [2]
9+
e = 3 : [1.1.4.7] => elements = [2,3]
10+
e = 4 : [1,1,1,7] => elements = [2,3,4]
11+
e = 5 : [1,1,1,7] => ์œ ์ง€
12+
e = 6 ...
13+
14+
"""
15+
def solution(arr) :
16+
answer = 1
17+
elements = []
18+
19+
e = 2
20+
# 1.
21+
while e<=100 or arr.count(1) != len(arr) :
22+
23+
flag = False
24+
#2. ํ•ด๋‹น e ๋กœ ๋ฐฐ์—ด arr ๊ฐ€ ๋‚˜๋ˆ„์–ด ๋–จ์–ด์ง€๋Š” ์ง€ ํ™•์ธ -> ๋–จ์–ด์ง€๋ฉด flag = True , ํ•ด๋‹น arr[k] ์€ e์˜ ๋ชซ์œผ๋กœ ๊ตฌ์„ฑํ•จ
25+
for k in range(len(arr)) :
26+
if arr[k] == 1 :
27+
continue
28+
if arr[k] % e == 0 :
29+
arr[k] =arr[k] // e
30+
flag = True
31+
#3. ํ•ด๋‹น e ๊ฐ’์ด ๋ฐฐ์—ด arr ์˜ ๊ฐ’ ์ค‘ ํ•˜๋‚˜ ์ด์ƒ์˜ ๊ตฌ์„ฑ ์š”์†Œ์ผ๋•Œ , ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜ ๊ตฌ์„ฑ์›Œ์†Œ elements ๋ฐฐ์—ด์— ์ถ”๊ฐ€
32+
if flag :
33+
elements.append(e)
34+
else : # ํ•ด๋‹น ๊ฐ’์ด ๊ตฌ์„ฑ ์›์†Œ ์•„๋‹ ๊ฒฝ์šฐ -> ๋‹ค์Œ e ๋กœ ๋‹ค์‹œ ๋„์ „ํ•˜๊ธฐ
35+
e+= 1
36+
37+
38+
for e in elements :
39+
answer*= e
40+
return answer
Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
11
"""
2-
์‹คํŒจ
3-
1. ๊ฐ€์žฅ ํฐ ์ž๋ฆฌ์ˆ˜ ๋น„๊ต -> ์ž๋ฆฌ์ˆ˜ ๊ฐ€์žฅ ์ž‘์€ ์ˆ˜
4-
0. graph
5-
idx : numbers
6-
value : [0,0,0,-1] # ex 62 => [6,2,False,False]
7-
# ์กฐ๊ฑด 2.
8-
3,30,300 ๋น„๊ต -> 3 > 30> 300 ์šฐ์„ ์ˆœ์œ„
9-
#๋ฐ˜๋ก€
10-
1) 110 vs 1 > 1+110
11-
2) [12, 1213] -> 1213+12
2+
https://www.programmers.co.kr/learn/courses/30/lessons/42746
123
"""
134

145
def solution(numbers):
15-
answer = ''
16-
#0. graph ๋งŒ๋“ค๊ธฐ
17-
graph = list()
18-
for n in numbers:
19-
p = 4-len(str(n))
20-
if p > 0 :
21-
douple_n = str(n)*p
22-
else :
23-
douple_n = str(n)
24-
graph.append([douple_n[:4], p ]) # ์ž๋ฆฌ์ˆ˜ ๋งž์ถฐ์ฃผ๊ธฐ(4์ž๋ฆฌ)
25-
# print(graph)
26-
#2.์ •๋ ฌ : ๋†’์€ ์ž๋ฆฌ์ˆ˜์˜ ๊ฐ’์ด ํฐ ์ˆœ์„œ ๋Œ€๋กœ
27-
graph.sort(key=lambda x : x[0] , reverse = True)
28-
# print(graph)
29-
#3. ํ•ฉ์น˜๊ธฐ
30-
answer=""
31-
for i in range(len(graph)):
32-
num = graph[i][0] ; position = 4-graph[i][1]
33-
answer += str(int(num[:position]))# "000","0" ๊ฒฝ์šฐ 0์œผ๋กœ ์ฒ˜๋ฆฌ
34-
6+
# 1. number์˜ ๊ฐ™์€ ๊ธธ์ด์— ๋Œ€ํ•ด์„œ ํฌ๊ธฐ ๋น„๊ตํ•˜๊ธฐ
7+
numbers_str = [str(num) for num in numbers ] # ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜
8+
numbers = sorted(numbers_str ,key = lambda x: x*3 , reverse = True )
9+
#2. ๋ฆฌ์ŠคํŠธ ์›์†Œ๋ฅผ 1๊ฐœ์˜ ๋ฌธ์ž์—ด๋กœ ์ถœ๋ ฅ ํ˜•์‹ ์ถฉ์กฑํ•˜๊ธฐ
10+
# answer = "".join(numbers)
11+
# print(answer , type(answer))
12+
answer = str(int("".join(numbers)))
13+
# print(answer , type(answer))
3514
return answer
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"""
2+
[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ๊ฑฐ๋ฆฌ๋‘๊ธฐ ํ™•์ธํ•˜๊ธฐ: ๋ฐฑํŠธ๋ ˆํ‚น / lv2
3+
https://school.programmers.co.kr/learn/courses/30/lessons/81302
4+
"""
5+
from collections import deque
6+
7+
dy =[1,-1,0,0] ; dx=[0,0,-1,1]
8+
def solution(places):
9+
answer = []
10+
for place in places :
11+
# 1. ์‘์‹œ์ž ์œ„์น˜ ํ™•์ธ
12+
people = []
13+
for i in range(5) :
14+
for j in range(5) :
15+
if place[i][j] == "P":
16+
people.append([i,j])
17+
#2. ์‘์‹œ์ž ๋ณ„๋กœ ๊ฑฐ๋ฆฌ ํ™•์ธํ•˜๊ธฐ
18+
def bfs(start):
19+
clv = 0
20+
visited = [[-1]*5 for _ in range(5)] # ๊ฑฐ๋ฆฌ ์ €์žฅํ•˜๊ธฐ(lv)
21+
q = deque([start])
22+
visited[start[0]][start[1]] = 0
23+
while q :
24+
cy,cx = q.popleft()
25+
clv = visited[cy][cx]
26+
if clv >= 2 :
27+
break
28+
for d in range(4):
29+
ny,nx = cy + dy[d] , cx +dx[d]
30+
if 0<= ny < 5 and 0 <= nx < 5 and visited[ny][nx] <= -1 :
31+
if place[ny][nx] == "X":
32+
visited[ny][nx] = clv +1
33+
continue
34+
elif place[ny][nx] == "O":
35+
q.append([ny,nx])
36+
visited[ny][nx] = clv +1
37+
elif place[ny][nx] == "P" :
38+
return False
39+
return True
40+
flag = True
41+
for p in range(len(people)):
42+
start = people[p]
43+
flag = bfs(start)
44+
if not flag :
45+
break
46+
if flag:
47+
answer.append(1)
48+
else :
49+
answer.append(0)
50+
51+
52+
# print(people)
53+
# print(f"answer{answer}")
54+
return answer
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
https://school.programmers.co.kr/learn/courses/30/lessons/42577
3+
"""
4+
5+
def solution(phone_book):
6+
answer = True
7+
#1. ๊ธ€์ž์ˆ˜๋กœ ์ •๋ ฌํ•˜๊ธฐ
8+
phone_book = sorted(phone_book , key = lambda x : (len(x)))
9+
#2. key = ์ „๋ฒˆ์ธ ํ•ด์‰ฌ๋งต ์ƒ์„ฑ
10+
hash_map = {}
11+
for phone in phone_book :
12+
hash_map[phone] = 1
13+
#3. hashmap์— ์ ‘๋‘์–ด ๋น„๊ตํ•˜๊ธฐ
14+
for phone in phone_book :
15+
tmp = ""
16+
# ์ ‘๋‘์–ด ํ•œ ๊ธ€์ž์”ฉ ์ถ”๊ฐ€ํ•ด์„œ hasp_map์˜ key๋“ค ์ค‘์— ๊ฐ™์€๊ฒŒ ์žˆ๋Š”์ง€ ํ™•์ธ
17+
for n in phone :
18+
tmp += n
19+
if tmp in hash_map and tmp!= phone :
20+
answer = False
21+
22+
23+
24+
25+
26+
return answer
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"""
2+
[BOJ]#16987.๊ณ„๋ž€์œผ๋กœ๊ณ„๋ž€์น˜๊ธฐ:๋ฐฑํŠธ๋ ˆํ‚น/๊ณจ๋“œ5
3+
https://www.acmicpc.net/problem/16987
4+
"""
5+
import sys
6+
7+
#0. ์ž…๋ ฅ ๋ณ€์ˆ˜ ์ •์˜ ๋ฐ ์ดˆ๊ธฐํ™” ํ•˜๊ธฐ
8+
input= sys.stdin.readline
9+
N = int(input())
10+
eggs = [[] for _ in range(N)]
11+
12+
for i in range(N):
13+
durability , weight =map(int ,input().split())
14+
eggs[i] = [durability , weight]
15+
16+
# 1. backtracking ์ˆ˜ํ–‰ํ•˜๊ธฐ
17+
max_cnt = 0
18+
def backtracking(idx,cnt) :
19+
global max_cnt
20+
print(f"stage {idx}")
21+
# pruning ์กฐ๊ฑด : ํ˜„์žฌ ๋‚จ์€ ํšŸ์ˆ˜๋กœ 2๊ฐœ์”ฉ ๊นจ๋„ max_cnt ์—…๋ฐ์ดํŠธ ๋ถˆ๊ฐ€ ๊ฒฝ์šฐ
22+
if max_cnt >= (cnt + (N-idx)*2):
23+
return 0
24+
#1. ์ข…๋ฃŒ ์กฐ๊ฑด : (1. ๋ชจ๋“  ๊ณ„๋ž€ ์„ ํƒ ์™„๋ฃŒ n == N)
25+
if idx >= N : # 1๊ฐœ ์ดํ•˜ ๋‚จ์•„์žˆ์„๋–„
26+
max_cnt = max(max_cnt , cnt)
27+
return 0
28+
29+
#1-2. ํ˜„์žฌ ์„ ํƒํ•œ ๊ณ„๋ž€ (idx) ๊ฐ€ ๊นจ์ ธ์žˆ๋Š” ๊ฒฝ์šฐ
30+
if eggs[idx][0] <= 0 :
31+
backtracking(idx+1 , cnt)
32+
#2.๋™์ž‘ ๊ณผ์ •- ๊ณ„๋ž€ ๊นจ๊ธฐ
33+
else : # ํ˜„์žฌ ๊ณ„๋ž€ lived -> ๋ถ€๋”ซํž ๊ณ„๋ž€ ์„ ํƒ & ๋ถ€๋”ซ์น˜๊ธฐ
34+
flag =False
35+
for j in range(N) :#ํ˜„์žฌ ๊ณ„๋ž€ ๋ถ€๋”ซ์น  ๊ณ„๋ž€ ์„ ํƒ (๋ณธ์ธidx ์•„๋‹˜ or ์ƒ์กด )
36+
if j!= idx and eggs[j][0] > 0 :
37+
# ์ถฉ๋Œ
38+
eggs[idx] =eggs[idx] -eggs[j][1]
39+
eggs[j] =eggs[j] -eggs[idx][1]
40+
backtracking(idx+1 , cnt+int(eggs[idx][0]<=0) + int(eggs[j][0]<=0) ) # ์ถฉ๋Œ ๊ณ„์‚ฐํ•˜๊ธฐ
41+
flag = True
42+
# ์ถฉ๋Œ ์›์ƒ ๋ณต๊ท€
43+
eggs[idx] =eggs[idx] +eggs[j][1]
44+
eggs[j] =eggs[j] +eggs[idx][1]
45+
# ํ•œ ๋ฒˆ๋„ ์•ˆ ๊นจ์ง -> ์„ ํƒํ•œ idx ๋‚ด๋ ค๋‘๊ณ  ๋‹ค์Œ idx +1 ๋กœ ์ด๋™
46+
if not flag :
47+
backtracking(idx+1 , cnt )
48+
49+
return 0
50+
51+
backtracking(0 ,0)
52+
print(max_cnt)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
[BOJ]6603๋กœ๋˜/์‹ค๋ฒ„2
3+
https://www.acmicpc.net/problem/6603
4+
5+
-์ฃผ์–ด์ง„ K๊ฐœ(k>6) ์ˆซ์ž์— 6๊ฐœ ๋ฝ‘์•„ ๋Œ€ํ•ด ์ค‘๋ณตx ํ•œ ์กฐํ•ฉ์˜ ๊ฒฝ์šฐ์˜ ์ˆ˜ ์ฐพ๊ธฐ
6+
->์ค‘๋ณต x , ์ˆœ์„œ ์ƒ๊ด€x
7+
- ํ•ด๋‹น ๋ชจ๋“  ๊ฒฝ์šฐ์˜ ์ˆ˜๋Š” ์‚ฌ์ „ ์ˆœ์œผ๋กœ ์ถœ๋ ฅ
8+
- ์ž…๋ ฅ : K , {ํ•ด๋‹นํ•˜๋Š” ์ˆซ์ž์˜ ์กฐํ•ฉ}
9+
"""
10+
11+
import sys
12+
input = sys.stdin.readline
13+
# 1. ์ž…๋ ฅ ๋ณ€์ˆ˜ ๋ฐ ์ถœ๋ ฅ ํ˜•์‹์— ๋งž์ถฐ ์„ค์ •ํ•˜๊ธฐ
14+
while True :
15+
set_s = list(map(int, input().split()))
16+
answer = []
17+
if len(set_s) < 2 :
18+
break
19+
k= set_s.pop(0)
20+
#2. ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ is_valid ์ •์˜
21+
# check = [True]*len(set_s[1:])
22+
result = [0]*6 # ์ถœ๋ ฅ ๋ฆฌ์ŠคํŠธ
23+
#3. ๋ฐฑํŠธ๋ž˜ํ‚น ํ•จ์ˆ˜ ์ •์˜
24+
def conbination(level ,idx ):
25+
#์ข…๋ฃŒ ์กฐ๊ฑด
26+
if level == 6 :
27+
answer.append(result.copy())
28+
# print(result)
29+
return
30+
# ๋™์ž‘ ๊ณผ์ •
31+
for i in range(idx,k):
32+
result[level] = set_s[i]
33+
conbination(level+1 ,i+1) # ์กฐํ•ฉ์€ idx ๋ณด๋‹ค ์ž‘์€ i๋Š” ํƒ์ƒ‰ ํ•  ํ•„์š” ์—†์Œ
34+
result[level] = 0
35+
conbination(0,0)
36+
# print(answer)
37+
# 3. ์ถœ๋ ฅ ํ˜•์‹ ๋งž์ถ”๊ธฐ
38+
for a in answer:
39+
print(" ".join(map(str,a)))
40+
print("")
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""
2+
## [๋ฐฑ์ค€] #1230. ๋ฌธ์ž์—ด๊ฑฐ๋ฆฌ: DP / ๊ณจ๋“œ1
3+
> ๋ฌธ์ œ ๋งํฌ : https://www.acmicpc.net/problem/1230
4+
"""
5+
import sys
6+
input = sys.stdin.readline
7+
# 0. ์ž…๋ ฅ ๋ณ€์ˆ˜ ์ •์˜ ๋ฐ ์ดˆ๊ธฐํ™” ํ•˜๊ธฐ
8+
o = list(input())
9+
l = list(input())
10+
INF = 1000
11+
if len(l) < len(o) :
12+
print(-1)
13+
exit()
14+
#1. dp ์ •์˜
15+
# dp[i][j][0] : de[i][j]๋กœ O[:i] == L[:j]
16+
dp = [[[0,0] for j in range(len(l)+1)] for i in range(len(o)+1)]
17+
# ์ดˆ๊ธฐํ™”
18+
dp[0][0] = [0,INF]
19+
for j in range(1,len(l)+1):
20+
dp[0][j][1] = 1
21+
dp[0][j][0] = INF
22+
# for i in range(len(o)+1):
23+
# dp[i][0][0] = -1
24+
25+
# #2. ์ ํ™”์‹
26+
for i in range(len(o)) :
27+
for j in range(i+1):
28+
dp[i+1][j][0] = dp[i+1][j][1] = INF
29+
for j in range(i, len(l)):
30+
if o[i] == l[j] :
31+
dp[i+1][j+1][0] = min(dp[i][j][0] , dp[i][j][1])
32+
else :
33+
dp[i+1][j+1][0] = INF
34+
dp[i+1][j+1][1] = min(dp[i+1][j][0] +1 , dp[i+1][j][1])
35+
#3. ์ถœ๋ ฅ
36+
if min(dp[-1][-1][0],dp[-1][-1][1]) >= INF :
37+
print(-1)
38+
else :
39+
print(min(dp[-1][-1][0] , dp[-1][-1][1]))
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
""""
2+
์‹ค๋ฒ„1
3+
https://www.acmicpc.net/problem/2468
4+
# ์กฐ๊ฑด :
5+
(1) ๋ฌผ์— ์ž ๊ธฐ์ง€ ์•Š์€ ๊ตฌ์—ญ ์œ„์น˜ ๊ตฌํ•˜๊ธฐ
6+
(2) ์•ˆ ์ž ๊ธด ๊ตฌ์—ญ๋“ค์˜ ๊ตฐ์ง‘ ๊ฐœ์ˆ˜ ์ฐพ๊ธฐ
7+
- ์ƒํ•˜์ขŒ์šฐ๋กœ ์—ฐ๊ฒฐ๋œ ๊ตฌ์—ญ = 1 ๊ตฐ์ง‘
8+
# ์œ ํ˜•: ๋…ธ๋“œ ํƒ์ƒ‰ -> BFS/DFS
9+
์—ฐ๊ฒฐ๋œ ๋…ธ๋“œ๋“ค์ด ์ด๋ฃจ๋Š” ๊ตฐ์ง‘ ๊ฐœ์ˆ˜ ๊ตฌํ•˜๋Š” ๋ฌธ์ œ
10+
11+
12+
"""
13+
import sys
14+
from collections import deque
15+
input = sys.stdin.readline
16+
17+
n = int(input())
18+
field = []
19+
limit_list= set()
20+
limit_list.add(0)
21+
# 1. ๋ฌผ์— ์ž ๊น€, ์ƒ์กด ๊ตฌ์—ญ์œผ๋กœ ๊ตฌ๋ถ„ํ•œ field ๋งŒ๋“ค๊ธฐ
22+
for i in range(n):
23+
tmp = list(map(int,input().split()))
24+
for j in range(n) :
25+
# limit_list ์ˆ˜์ง‘ํ•˜๊ธฐ = ๋…ธ๋“œ์˜ ๋†’์ด ๊ฐ’ ์ข…๋ฅ˜
26+
limit_list.add(tmp[j])
27+
field.append(tmp)
28+
# print(f"field - {limit_list}")
29+
30+
31+
# ์ข…๋ฅ˜๋ณ„ limit์— ๋”ฐ๋ผ ์ง€๋Œ€ ๋†’์ด๊ฐ€ limit ์ดํ•˜์ผ ๊ฒฝ์šฐ ์นจ์ˆ˜๋˜๋Š” ์ง€์—ญ, ์ƒ์กด ์ง€์—ญ ๋ช…์‹œ
32+
# board : ์ƒ์กด ์—ฌ๋ถ€ + ๋ฐฉ๋ฌธ ์—ฌ๋ถ€ ํ™•์ธ flag ์—ญํ• 
33+
def init_board(limit) :
34+
# ๊ฐ limit ๋ณ„๋กœ ์นจ์ˆ˜๋˜๋Š” ์ง€์—ญ์„ ํ™•์ธํ•˜๊ธฐ
35+
board = [[0 for _ in range(n)] for k in range(n) ]
36+
saved_point = []
37+
# ์นจ์ˆ˜ ์ง€์—ญ ๋งต ์—…๋ฐ์ดํŠธํ•˜๊ธฐ
38+
for i in range(n):
39+
for k in range(n):
40+
if field[i][k] <= limit : # ์นจ์ˆ˜ ์ง€์—ญ
41+
board[i][k] =-1
42+
else :
43+
# ์ƒ์กด ์ง€์—ญ
44+
saved_point.append([i,k])
45+
return board,saved_point
46+
47+
# 2. ์ƒ์กด ๊ตฌ์—ญ๋“ค์˜ ๊ตฐ์ง‘ ๊ฐœ์ˆ˜ ๊ตฌํ•˜๊ธฐ
48+
#์ƒํ•˜์ขŒ์šฐ
49+
dy =[-1,1,0,0 ]
50+
dx = [0,0,-1,1]
51+
def bfs(sy,sx , field):
52+
# (1)์‹œ์ž‘์  ์ •์˜
53+
q = deque()
54+
q.append([sy,sx])
55+
field[sy][sx] = 1 # ๋ฐฉ๋ฌธ ๋“ฑ๋ก
56+
# (2)์ธ์ ‘ํ•œ ๋…ธ๋“œ
57+
while q :
58+
cy,cx =q.popleft()
59+
for dw in range(4):
60+
ny,nx = cy + dy[dw] , cx +dx[dw]
61+
# 2-1 ํ•„๋“œ ๋ฒ”์œ„์—์„œ ๋ฒ—์–ด๋‚˜๋Š”์ง€ ํ™•์ธ
62+
# 2-2๋ฐฉ๋ฌธ ์—ฌ๋ถ€ ํ™•์ธ
63+
if 0<= ny < n and 0<= nx < n and field[ny][nx] == 0 : # ๋ฐฉ๋ฌธ ์•ˆํ–ˆ์œผ๋ฉด ์—…๋ฐ์ดํŠธ
64+
q.append([ny,nx])
65+
field[ny][nx] = 1
66+
67+
return 0
68+
# main ํ•จ์ˆ˜
69+
max_cnt = 0
70+
for limit in limit_list : #limit ์„ 1๊ฐœ์”ฉ ์กฐํ•ฉํ•ด๋ด„
71+
board,saved_point = init_board(limit)
72+
# print(f"##{limit} : {saved_point}")
73+
cnt = 0
74+
# ์ƒ์กด ๊ตฌ์—ญ์—์„œ ํ™•์ธ
75+
for y,x in saved_point :
76+
if board[y][x] == 0 :#๋ฐฉ๋ฌธ ์•ˆํ–ˆ์œผ๋ฉด -> bfs ํƒ์ƒ‰ ์ง„ํ–‰
77+
bfs(y,x, board)
78+
cnt +=1
79+
80+
max_cnt = max(max_cnt , cnt)
81+
print(max_cnt)

0 commit comments

Comments
ย (0)