title: Squared Triangular Number Sum Cubes
signature: function squared_triangular_number_sum_cubes(s)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(s, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(s), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(15, -1);
      @printf("TEST-0...%s\n",result);
      
      result = driver(36, 3);
      @printf("TEST-1...%s\n",result);
      
      result = driver(39, -1);
      @printf("TEST-2...%s\n",result);
      
      result = driver(43, -1);
      @printf("TEST-3...%s\n",result);
      
      result = driver(75, -1);
      @printf("TEST-4...%s\n",result);
      
      result = driver(49, -1);
      @printf("TEST-5...%s\n",result);
      
      result = driver(56, -1);
      @printf("TEST-6...%s\n",result);
      
      result = driver(14, -1);
      @printf("TEST-7...%s\n",result);
      
      result = driver(62, -1);
      @printf("TEST-8...%s\n",result);
      
      result = driver(97, -1);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }