title: Triangular Numbers
signature: class Solution {
  
      public Boolean triangularNumbers(Integer num) {
source_py: def triangular_numbers(num):
      if (num < 0):
          return False
      (sum, n) = (0, 1)
      while (sum <= num):
          sum = (sum + n)
          if (sum == num):
              return True
          n += 1
      return False
source_cpp: bool triangular_numbers(int num) {
    if ( num < 0 ) return false;
    int sum = 0;
    for ( int n = 1;
    sum <= num;
    n ++ ) {
      sum = sum + n;
      if ( sum == num ) return true;
    }
    return false;
  }
question_info.extension: java
question_info.entry_fn_name: triangularNumbers
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"num": 97}}, {"idx": 1, "outputs": false, "inputs": {"num": 97}}, {"idx": 2, "outputs": false, "inputs": {"num": 32}}, {"idx": 3, "outputs": false, "inputs": {"num": 40}}, {"idx": 4, "outputs": false, "inputs": {"num": 18}}, {"idx": 5, "outputs": false, "inputs": {"num": 14}}, {"idx": 6, "outputs": false, "inputs": {"num": 90}}, {"idx": 7, "outputs": false, "inputs": {"num": 39}}, {"idx": 8, "outputs": true, "inputs": {"num": 1}}, {"idx": 9, "outputs": false, "inputs": {"num": 57}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer num, Boolean expected){
          try{
              Driver driver = new Driver();
              if (driver.run(num,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(97, false);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(97, false);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(32, false);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(40, false);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(18, false);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(14, false);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(90, false);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(39, false);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(1, true);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(57, false);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer num, Boolean expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);
      }
      
      public boolean validateSolution(Boolean actual, Boolean expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__