a
, b
: -10,000,000 이상 10,000,000 이하의 정수
편의상 a<b라고 할 때, 둘을 포함하여 a에서 b까지 정수의 합은 다음과 같다.
def solution(a, b):
tmp= (max(a,b)-min(a,b)+1)/2
return (a+b)*tmp
def solution(strings, n):
return sorted(sorted(strings), key=lambda x:x[n])
s
: 대문자와 소문자가 섞여있는 문자열, 길이는 50 이하이며 알파벳으로만 이루어져 있음
def solution(s):
s= s.lower()
return True if s.count('p') == s.count('y') else False
[ 문제 링크 ](def solution(s):
return "".join(sorted(s))[::-1])
str
: 길이 1 이상의 문자열, 대문자는 소문자보다 작은 것으로 간주
def solution(s):
return "".join(sorted(s))[::-1]