CHIqueen
[Intro] isIPv4Addres
def isIPv4Address(s): p = s.split('.') return len(p) == 4 and all(n.isdigit() and 0 True ??? SSIBAL def isIPv4Address(s): p = s.split('.') for i in p: if len(i)>=2: if list(i)[0]=='0': return False return len(p) == 4 and all(n.isdigit() and 0
프로그래밍/CodeSignal
2020. 3. 17. 17:48
[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