Solución
solution.tsTypeScript
import math
def is_perfect_square(n: int) -> bool:
if n < 0:
return False
s = math.isqrt(n)
return s * s == n
def is_fibonacci(n: int) -> bool:
return is_perfect_square(5 * n * n + 4) or is_perfect_square(5 * n * n - 4)0respuestas