CHIqueen
[Intro] arrayMaximalAdjacentDifference
def arrayMaximalAdjacentDifference(inputArray): return max([abs(inputArray[i]-inputArray[i+1]) for i in range(len(inputArray)-1)])
프로그래밍/CodeSignal
2020. 3. 17. 16:52
[Intro] areEquallyStrong
def areEquallyStrong(yourLeft, yourRight, friendsLeft, friendsRight): return (yourLeft == friendsLeft or yourLeft == friendsRight) and (yourRight == friendsLeft or yourRight == friendsRight) 굉장히 쓰잘떼기 없어보이지만 통과다 return {yourLeft, yourRight} == {friendsLeft, friendsRight} 파이썬의 set을 잘 사용한 예시
프로그래밍/CodeSignal
2020. 3. 17. 16:45