8 kyu
Find Nearest square number
9,313 of 24,778riyakayal
Description:
Your task is to find the nearest square number of a positive integer n
. In mathematics, a square number or perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself.
For example, if n = 111
, then the nearest square number equals 121, since 111 is closer to 121, the square of 11, than 100, the square of 10.
If n
is already a perfect square (e.g. n = 144
, n = 81
, etc.), you need to just return n
.
Good luck :)
Check my other katas:
Fundamentals
Mathematics
Similar Kata:
Stats:
Created | Feb 11, 2018 |
Published | Feb 11, 2018 |
Warriors Trained | 44074 |
Total Skips | 2243 |
Total Code Submissions | 59001 |
Total Times Completed | 24778 |
Python Completions | 9313 |
Java Completions | 3207 |
JavaScript Completions | 9085 |
Ruby Completions | 552 |
Crystal Completions | 29 |
Haskell Completions | 249 |
Lua Completions | 228 |
C Completions | 840 |
NASM Completions | 29 |
Racket Completions | 40 |
Groovy Completions | 70 |
C# Completions | 828 |
Rust Completions | 448 |
TypeScript Completions | 382 |
D Completions | 18 |
Go Completions | 604 |
Scala Completions | 31 |
CoffeeScript Completions | 12 |
Prolog Completions | 11 |
Total Stars | 363 |
% of votes with a positive feedback rating | 91% of 2548 |
Total "Very Satisfied" Votes | 2141 |
Total "Somewhat Satisfied" Votes | 335 |
Total "Not Satisfied" Votes | 72 |
Total Rank Assessments | 12 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |