나머지 연산을 한 결과로 슬라이스하여 결과를 도출
def solution(s):
length = len(s)
if length % 2 == 1:
return s[int(length / 2)]
else:
return s[int(length / 2)-1:int(length / 2)+1]
나머지 연산을 한 결과로 슬라이스하여 결과를 도출
def solution(s):
length = len(s)
if length % 2 == 1:
return s[int(length / 2)]
else:
return s[int(length / 2)-1:int(length / 2)+1]
댓글