title: Bell Numbers Number Of Ways To Partition A Set
signature: def bell_numbers_number_of_ways_to_partition_a_set(n):
source_py: def bell_numbers_number_of_ways_to_partition_a_set(n):
      bell = [[0 for i in range((n + 1))] for j in range((n + 1))]
      bell[0][0] = 1
      for i in range(1, (n + 1)):
          bell[i][0] = bell[(i - 1)][(i - 1)]
          for j in range(1, (i + 1)):
              bell[i][j] = (bell[(i - 1)][(j - 1)] + bell[i][(j - 1)])
      return bell[n][0]
source_cpp: int bell_numbers_number_of_ways_to_partition_a_set(int n) {
    int bell [ n + 1 ] [ n + 1 ];
    bell [ 0 ] [ 0 ] = 1;
    for ( int i = 1;
    i <= n;
    i ++ ) {
      bell [ i ] [ 0 ] = bell [ i - 1 ] [ i - 1 ];
      for ( int j = 1;
      j <= i;
      j ++ ) bell [ i ] [ j ] = bell [ i - 1 ] [ j - 1 ] + bell [ i ] [ j - 1 ];
    }
    return bell [ n ] [ 0 ];
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(n, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              n),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver(9, 21147)
      print(f"TEST-0...{result}")
  
      result = driver(4, 15)
      print(f"TEST-1...{result}")
  
      result = driver(6, 203)
      print(f"TEST-2...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2']
question_info.entry_fn_name: bell_numbers_number_of_ways_to_partition_a_set
question_info.test_list: [{"idx": 0, "outputs": 21147, "inputs": {"n": 9}}, {"idx": 1, "outputs": 15, "inputs": {"n": 4}}, {"idx": 2, "outputs": 203, "inputs": {"n": 6}}]
question_info.entry_cls_name: Solution