7 kyu
Find the next perfect square!
19,006 of 172,224kphurley
Description:
You might know some pretty large perfect squares. But what about the NEXT one?
Complete the findNextSquare
method that finds the next integral perfect square after the one passed as a parameter. Recall that an integral perfect square is an integer n such that sqrt(n) is also an integer.
If the argument is itself not a perfect square then return either -1
or an empty value like None
or null
, depending on your language. You may assume the argument is non-negative.
Examples ( Input --> Output )
121 --> 144
625 --> 676
114 --> -1 # because 114 is not a perfect square
Algebra
Fundamentals
Similar Kata:
Stats:
Created | Oct 20, 2015 |
Published | Oct 20, 2015 |
Warriors Trained | 292443 |
Total Skips | 38367 |
Total Code Submissions | 421866 |
Total Times Completed | 172224 |
Java Completions | 19006 |
Ruby Completions | 4801 |
Python Completions | 65210 |
JavaScript Completions | 61995 |
C# Completions | 9138 |
CoffeeScript Completions | 91 |
C++ Completions | 8799 |
Haskell Completions | 432 |
Rust Completions | 1347 |
COBOL Completions | 16 |
Factor Completions | 15 |
Go Completions | 1394 |
D Completions | 11 |
C Completions | 1590 |
Lua Completions | 163 |
TypeScript Completions | 428 |
λ Calculus Completions | 4 |
Total Stars | 1430 |
% of votes with a positive feedback rating | 90% of 13539 |
Total "Very Satisfied" Votes | 10986 |
Total "Somewhat Satisfied" Votes | 2282 |
Total "Not Satisfied" Votes | 271 |
Total Rank Assessments | 58 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |