title: Square Pyramidal Number Sum Squares
signature: squarePyramidalNumberSumSquares :: Integer -> Integer
  squarePyramidalNumberSumSquares s = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> String
  driver s expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME s) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (1) (1) )
  
      printf "TEST-1...%s\n" (driver (5) (2) )
  
      printf "TEST-2...%s\n" (driver (14) (3) )
  
      printf "TEST-3...%s\n" (driver (140) (7) )
  
      printf "TEST-4...%s\n" (driver (204) (8) )
  
      printf "TEST-5...%s\n" (driver (3) (-1) )
  
      printf "TEST-6...%s\n" (driver (506) (11) )
  
      printf "TEST-7...%s\n" (driver (42) (-1) )
  
      printf "TEST-8...%s\n" (driver (4) (-1) )
  
      printf "TEST-9...%s\n" (driver (87) (-1) )
  
source_py: def square_pyramidal_number_sum_squares(s):
      _sum = 0
      n = 1
      while (_sum < s):
          _sum += (n * n)
          n += 1
      n -= 1
      if (_sum == s):
          return n
      return (- 1)
source_cpp: int square_pyramidal_number_sum_squares(int s) {
    int sum = 0;
    for ( int n = 1;
    sum < s;
    n ++ ) {
      sum += n * n;
      if ( sum == s ) return n;
    }
    return - 1;
  }