title: Sum Subsets Set Formed First N Natural Numbers
signature: fun sumSubsetsSetFormedFirstNNaturalNumbers(n: Int): Double {
source_py: def sum_subsets_set_formed_first_n_natural_numbers(n):
      return (((n * (n + 1)) / 2) * (1 << (n - 1)))
source_cpp: unsigned long long sum_subsets_set_formed_first_n_natural_numbers(int n) {
    return ( n * ( n + 1 ) / 2 ) * ( 1 << ( n - 1 ) );
  }
question_info.test_list: [{"idx": 0, "outputs": 11777605632.0, "inputs": {"n": 26}}, {"idx": 1, "outputs": 10823317585920.0, "inputs": {"n": 35}}, {"idx": 2, "outputs": 5111011082240.0, "inputs": {"n": 34}}, {"idx": 3, "outputs": 530579456.0, "inputs": {"n": 22}}, {"idx": 4, "outputs": 24.0, "inputs": {"n": 3}}, {"idx": 5, "outputs": 5452595200.0, "inputs": {"n": 25}}, {"idx": 6, "outputs": 530579456.0, "inputs": {"n": 22}}]
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(26, 11777605632.0)
      println("TEST-0...${result}")
      
      result = driver(35, 10823317585920.0)
      println("TEST-1...${result}")
      
      result = driver(34, 5111011082240.0)
      println("TEST-2...${result}")
      
      result = driver(22, 530579456.0)
      println("TEST-3...${result}")
      
      result = driver(3, 24.0)
      println("TEST-4...${result}")
      
      result = driver(25, 5452595200.0)
      println("TEST-5...${result}")
      
      result = driver(22, 530579456.0)
      println("TEST-6...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: sumSubsetsSetFormedFirstNNaturalNumbers
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn