title: Count Strings Can Formed Using B C Given Constraints 1
signature: func countStringsCanFormedUsingBCGivenConstraints1(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(55, 83271)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(36, 23383)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(69, 164359)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(92, 389483)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(73, 194619)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(16, 2073)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(88, 340869)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(19, 3459)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(66, 143848)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(68, 157319)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 );
  }