codakata day 5

Jae Hoon Shin, 신재훈, Noah·2020년 11월 6일
0

내가 처음에 생각한것,,

def get_prefix(string):
  if len(string) == 0:
    return ""
  
  string = sorted(string)
  common_prefix = ""
  
  else:
    for str in string[0]:
      if string[]
    startswith[ ,[0],[-1]]
  return st  

도움 받고 쓰고 있는 것 (아래)

def get_prefix(string):
  if len(string) == 0:
    return ""
  string = sorted(string)
  common_prefix = ""
   for letter in string[0]:
       if strs[-1].startswith(res+i):
           res += i
       else:
           break
   return res
profile
🇰🇷🇺🇸 #Back-End Engineer

0개의 댓글