title: Count Strings Can Formed Using B C Given Constraints 1
signature: function countStringsCanFormedUsingBCGivenConstraints1(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(55, 83271);
    console.log(`TEST-0...${result}`);
  
    result = driver(36, 23383);
    console.log(`TEST-1...${result}`);
  
    result = driver(69, 164359);
    console.log(`TEST-2...${result}`);
  
    result = driver(92, 389483);
    console.log(`TEST-3...${result}`);
  
    result = driver(73, 194619);
    console.log(`TEST-4...${result}`);
  
    result = driver(16, 2073);
    console.log(`TEST-5...${result}`);
  
    result = driver(88, 340869);
    console.log(`TEST-6...${result}`);
  
    result = driver(19, 3459);
    console.log(`TEST-7...${result}`);
  
    result = driver(66, 143848);
    console.log(`TEST-8...${result}`);
  
    result = driver(68, 157319);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def count_strings_can_formed_using_b_c_given_constraints_1(n):
      return ((1 + (n * 2)) + ((n * ((n * n) - 1)) // 2))
source_cpp: int count_strings_can_formed_using_b_c_given_constraints_1(int n) {
    return 1 + ( n * 2 ) + ( n * ( ( n * n ) - 1 ) / 2 );
  }