Next Square Up

A perfect square is a number that can be written as x * x for some integer x. Given a non-negative integer num, check whether it is a perfect square. If it is, return the next perfect square after it; otherwise, return -1.

Примеры

Ввод
25
Вывод
36
Ввод
0
Вывод
1
Ввод
121
Вывод
144

Нужно реализовать

def find_next_square(num: int) -> int:

Теги

math
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Visible tests
1
Input
25
Expected36
2
Input
0
Expected1
3
Input
121
Expected144
4
Input
10
Expected-1
5
Input
1
Expected4
6
Input
7
Expected-1
Focus radio
Paused · SomaFM · Fluid