Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Commit 90d2ac1

Browse files
authored
Update 20437_문자열게임2.py
1 parent 187e179 commit 90d2ac1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opijae/string/20437_문자열게임2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
num=int(input())
88
set_string=set(string) # set을 이용해 unique 문자들만 가져옴
99
_max,_min=0,100000
10-
for s in string:
10+
for s in set_string:
1111
match_iters=re.finditer(s, string) # 정규식을 사용해 target 위치 찾기 match_iters => iterater, <_sre.SRE_Match object; span=(1 시작점, 2 끝점), match='a'>
1212
match_list_idx=[x.start() for x in match_iters] # target위치의 시작점들만 저장
1313
cnt=0
@@ -24,4 +24,4 @@
2424
if _max+_min==100000:
2525
print(-1)
2626
else:
27-
print(_min+1,_max+1)
27+
print(_min+1,_max+1)

0 commit comments

Comments
 (0)