title: Square Pyramidal Number Sum Squares
signature: def squarePyramidalNumberSumSquares(s: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(s: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(s),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        1, 
        1    
      )}")   
  
  
      println(s"TEST-1...${driver(
        5, 
        2    
      )}")   
  
  
      println(s"TEST-2...${driver(
        14, 
        3    
      )}")   
  
  
      println(s"TEST-3...${driver(
        140, 
        7    
      )}")   
  
  
      println(s"TEST-4...${driver(
        204, 
        8    
      )}")   
  
  
      println(s"TEST-5...${driver(
        3, 
        -1    
      )}")   
  
  
      println(s"TEST-6...${driver(
        506, 
        11    
      )}")   
  
  
      println(s"TEST-7...${driver(
        42, 
        -1    
      )}")   
  
  
      println(s"TEST-8...${driver(
        4, 
        -1    
      )}")   
  
  
      println(s"TEST-9...${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;
  }