CHIqueen
[Intro] palindromeRearranging
def palindromeRearranging(inputString): return sum([inputString.count(i)%2 for i in set(inputString)])
프로그래밍/CodeSignal
2020. 3. 17. 16:39
[Intro] Are Similar?
Two arrays are called similar if one can be obtained from another by swapping at most one pair of elements in one of the arrays. Given two arrays a and b, check whether they are similar. def areSimilar(a, b): return sorted(a)==sorted(b) and sum([c!=d for c,d in zip(a,b)])
프로그래밍/CodeSignal
2020. 3. 17. 16:05