title: Squared Triangular Number Sum Cubes
signature: fun squaredTriangularNumberSumCubes(s: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(s: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(15, -1)
      println("TEST-0...${result}")
      
      result = driver(36, 3)
      println("TEST-1...${result}")
      
      result = driver(39, -1)
      println("TEST-2...${result}")
      
      result = driver(43, -1)
      println("TEST-3...${result}")
      
      result = driver(75, -1)
      println("TEST-4...${result}")
      
      result = driver(49, -1)
      println("TEST-5...${result}")
      
      result = driver(56, -1)
      println("TEST-6...${result}")
      
      result = driver(14, -1)
      println("TEST-7...${result}")
      
      result = driver(62, -1)
      println("TEST-8...${result}")
      
      result = driver(97, -1)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def squared_triangular_number_sum_cubes(s):
      _sum = 0
      n = 1
      while (_sum < s):
          _sum += ((n * n) * n)
          n += 1
      n -= 1
      if (_sum == s):
          return n
      return (- 1)
source_cpp: int squared_triangular_number_sum_cubes(int s) {
    int sum = 0;
    for ( int n = 1;
    sum < s;
    n ++ ) {
      sum += n * n * n;
      if ( sum == s ) return n;
    }
    return - 1;
  }