title: Sum Subsets Set Formed First N Natural Numbers
signature: class Solution {
  
      public Double sumSubsetsSetFormedFirstNNaturalNumbers(Integer n) {
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.extension: java
question_info.entry_fn_name: sumSubsetsSetFormedFirstNNaturalNumbers
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Double expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(26, 11777605632.0);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(35, 10823317585920.0);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(34, 5111011082240.0);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(22, 530579456.0);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(3, 24.0);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(25, 5452595200.0);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(22, 530579456.0);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6
question_info.commands: java __FILENAME__