[프로그래머스] 정수 제곱근 판별Lv.1 - Python

GoshK·2022년 1월 28일
0

[프로그래머스] Python

목록 보기
11/68
post-thumbnail

[프로그래머스] 정수 제곱근 판별Lv.1

나의 풀이

from math import sqrt

def solution(n):
    temp = sqrt(n)
    return int(pow(temp + 1, 2)) if temp == int(temp) else -1

0개의 댓글