Notice
Recent Posts
Recent Comments
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Tags
more
Archives
Today
Total
관리 메뉴

CHIqueen

[Intro] palindromeRearranging 본문

프로그래밍/CodeSignal

[Intro] palindromeRearranging

CHIqueen 2020. 3. 17. 16:39
def palindromeRearranging(inputString):
    return sum([inputString.count(i)%2 for i in set(inputString)]) <= 1

중복을 없애준 다음에 각 요소별 갯수가 짝수인지 계산한다

만약 리스트의 길이가 홀수 일경우에 대비해 1이하라고 해뒀다.

'프로그래밍 > CodeSignal' 카테고리의 다른 글

[Intro] arrayMaximalAdjacentDifference  (0) 2020.03.17
[Intro] areEquallyStrong  (0) 2020.03.17
[Intro] Are Similar?  (0) 2020.03.17
[Intro] Add Border  (0) 2020.03.17
[Intro] alternationSums  (0) 2020.03.17
Comments