title: Count Even Length Binary Sequences With Same Sum Of First And Second Half Bits 1
signature: fun countEvenLengthBinarySequencesWithSameSumOfFirstAndSecondHalfBits1(n: Int): Double {
source_py: def count_even_length_binary_sequences_with_same_sum_of_first_and_second_half_bits_1(n):
      nCr = 1
      res = 1
      for r in range(1, (n + 1)):
          nCr = ((nCr * ((n + 1) - r)) / r)
          res += (nCr * nCr)
      return res
source_cpp: int count_even_length_binary_sequences_with_same_sum_of_first_and_second_half_bits_1(int n) {
    int nCr = 1, res = 1;
    for ( int r = 1;
    r <= n;
    r ++ ) {
      nCr = ( nCr * ( n + 1 - r ) ) / r;
      res += nCr * nCr;
    }
    return res;
  }
question_info.test_list: [{"idx": 0, "outputs": 126410606437752.0, "inputs": {"n": 25}}, {"idx": 1, "outputs": 9075135300.0, "inputs": {"n": 18}}, {"idx": 2, "outputs": 2333606220.0, "inputs": {"n": 17}}, {"idx": 3, "outputs": 12870.0, "inputs": {"n": 8}}, {"idx": 4, "outputs": 12870.0, "inputs": {"n": 8}}]
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:Double, expected:Double):Boolean{
    return abs(actual - expected) < 1e-09
  }
  fun driver(n: Int, expected:Double):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(25, 126410606437752.0)
      println("TEST-0...${result}")
      
      result = driver(18, 9075135300.0)
      println("TEST-1...${result}")
      
      result = driver(17, 2333606220.0)
      println("TEST-2...${result}")
      
      result = driver(8, 12870.0)
      println("TEST-3...${result}")
      
      result = driver(8, 12870.0)
      println("TEST-4...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: countEvenLengthBinarySequencesWithSameSumOfFirstAndSecondHalfBits1
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn