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:

Alphabetically ordered

Case-sensitive!

Not prime numbers

Find your caterer

Fundamentals
Mathematics

Stats:

CreatedFeb 11, 2018
PublishedFeb 11, 2018
Warriors Trained44074
Total Skips2243
Total Code Submissions59001
Total Times Completed24778
Python Completions9313
Java Completions3207
JavaScript Completions9085
Ruby Completions552
Crystal Completions29
Haskell Completions249
Lua Completions228
C Completions840
NASM Completions29
Racket Completions40
Groovy Completions70
C# Completions828
Rust Completions448
TypeScript Completions382
D Completions18
Go Completions604
Scala Completions31
CoffeeScript Completions12
Prolog Completions11
Total Stars363
% of votes with a positive feedback rating91% of 2548
Total "Very Satisfied" Votes2141
Total "Somewhat Satisfied" Votes335
Total "Not Satisfied" Votes72
Total Rank Assessments12
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • riyakayal Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • mitron6 Avatar
  • Souzooka Avatar
  • pcdl Avatar
  • lbvf50mobile Avatar
  • a.kozhanov Avatar
  • user4444589 Avatar
  • ManuGilDev Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • uniapi Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • Edoebzd Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • NikCSharp Avatar
  • MingLeeNg Avatar
  • 4500zenja1 Avatar
  • KayleighWasTaken Avatar
  • dnskkv Avatar
Ad