title: Primality Test Set 1 Introduction And School Method
signature: fun primalityTestSet1IntroductionAndSchoolMethod(n: Int): Boolean {
source_py: def primality_test_set_1_introduction_and_school_method(n):
      if (n <= 1):
          return False
      for i in range(2, n):
          if ((n % i) == 0):
              return False
      return True
source_cpp: bool primality_test_set_1_introduction_and_school_method(int n) {
    if ( n <= 1 ) return false;
    for ( int i = 2;
    i < n;
    i ++ ) if ( n % i == 0 ) return false;
    return true;
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"n": 37}}, {"idx": 1, "outputs": false, "inputs": {"n": 39}}, {"idx": 2, "outputs": true, "inputs": {"n": 73}}, {"idx": 3, "outputs": false, "inputs": {"n": 8}}, {"idx": 4, "outputs": false, "inputs": {"n": 28}}, {"idx": 5, "outputs": false, "inputs": {"n": 66}}, {"idx": 6, "outputs": false, "inputs": {"n": 20}}, {"idx": 7, "outputs": false, "inputs": {"n": 36}}, {"idx": 8, "outputs": false, "inputs": {"n": 6}}, {"idx": 9, "outputs": false, "inputs": {"n": 51}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(37, true)
      println("TEST-0...${result}")
      
      result = driver(39, false)
      println("TEST-1...${result}")
      
      result = driver(73, true)
      println("TEST-2...${result}")
      
      result = driver(8, false)
      println("TEST-3...${result}")
      
      result = driver(28, false)
      println("TEST-4...${result}")
      
      result = driver(66, false)
      println("TEST-5...${result}")
      
      result = driver(20, false)
      println("TEST-6...${result}")
      
      result = driver(36, false)
      println("TEST-7...${result}")
      
      result = driver(6, false)
      println("TEST-8...${result}")
      
      result = driver(51, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: primalityTestSet1IntroductionAndSchoolMethod
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn