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

Stats:

CreatedOct 20, 2015
PublishedOct 20, 2015
Warriors Trained292443
Total Skips38367
Total Code Submissions421866
Total Times Completed172224
Java Completions19006
Ruby Completions4801
Python Completions65210
JavaScript Completions61995
C# Completions9138
CoffeeScript Completions91
C++ Completions8799
Haskell Completions432
Rust Completions1347
COBOL Completions16
Factor Completions15
Go Completions1394
D Completions11
C Completions1590
Lua Completions163
TypeScript Completions428
λ Calculus Completions4
Total Stars1430
% of votes with a positive feedback rating90% of 13539
Total "Very Satisfied" Votes10986
Total "Somewhat Satisfied" Votes2282
Total "Not Satisfied" Votes271
Total Rank Assessments58
Average Assessed Rank
6 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • kphurley Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • raulbc777 Avatar
  • CrazyMerlyn Avatar
  • Jotha Avatar
  • cesarmuzel Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • acjoker Avatar
  • AlexPuts Avatar
  • kroppt Avatar
  • Awesome A.D. Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • trashy_incel Avatar
  • username0 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Ciprian Amza Avatar
  • Kacarott Avatar
  • razetime Avatar
  • NikCSharp Avatar
  • fcr-- Avatar
  • JavaScripts Avatar
Ad