728x90 반응형 알고리즘 문제풀이/코딜리티1 Codility Exercise4 First Unique 코드 from collections import Counter def solution(A): my_cnt = Counter(A) for i in my_cnt.keys(): if my_cnt[i] == 1: return i return -1 StrSymmetryPoint 코드 def solution(S): if len(S) == 1: return 0 if len(S) % 2 == 0: return -1 for i in range(len(S) // 2): if S[i] != S[-(i+1)]: return -1 return len(S) // 2 return cnt TreeHeight 코드 from extratypes import Tree # library with types used .. 2023. 6. 22. 이전 1 다음 728x90 반응형