Square Number Check
A perfect square is a number you can get by multiplying an integer by itself. The function is_perfect_square receives a non-negative integer n and returns True if it is a perfect square, otherwise False. For example, 16 qualifies because it is 4 * 4.
Примеры
Ввод
16Вывод
TrueВвод
15Вывод
FalseВвод
0Вывод
TrueНужно реализовать
def is_perfect_square(n: int) -> bool:
Теги
mathbinary-search
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj sięVisible tests
1
Input
16Expected
True2
Input
15Expected
False3
Input
0Expected
True4
Input
1Expected
True5
Input
10000Expected
True6
Input
1000Expected
FalseFocus radio
Paused · SomaFM · Fluid