[Programmers] 정수 제곱근 판별
Python import math def solution(n): if math.sqrt(n) == int(math.sqrt(n)): return (math.sqrt(n) + 1) ** 2 return -1
Python import math def solution(n): if math.sqrt(n) == int(math.sqrt(n)): return (math.sqrt(n) + 1) ** 2 return -1
Python def solution(n): temp = list(str(n)) temp.sort(reverse = True) return int("".join(temp))
Python def solution(n): answer = list(str(n)) answer.reverse() return list(map(int, answer))
Python import math def solution(n, m): answer = [math.gcd(n, m), ((n * m) // math.gcd(n, m))] return answer
Python def solution(num): answer = '' if num % 2 == 0: return 'Even' else: return 'Odd'