title: Squared Triangular Number Sum Cubes
signature: class Solution {
  
      public Integer squaredTriangularNumberSumCubes(Integer s) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer s, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(s,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(15, -1);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(36, 3);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(39, -1);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(43, -1);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(75, -1);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(49, -1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(56, -1);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(14, -1);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(62, -1);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(97, -1);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer s, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(s),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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;
  }