title: Count Numbers Can Constructed Using Two Numbers
signature: function countNumbersCanConstructedUsingTwoNumbers(n: number, x: number, y: number): number {
source_py: def count_numbers_can_constructed_using_two_numbers(n, x, y):
      arr = [False for i in range((n + 2))]
      if (x <= n):
          arr[x] = True
      if (y <= n):
          arr[y] = True
      result = 0
      for i in range(min(x, y), (n + 1)):
          if arr[i]:
              if ((i + x) <= n):
                  arr[(i + x)] = True
              if ((i + y) <= n):
                  arr[(i + y)] = True
              result = (result + 1)
      return result
source_cpp: int count_numbers_can_constructed_using_two_numbers(int n, int x, int y) {
    vector < bool > arr ( n + 1, false );
    if ( x <= n ) arr [ x ] = true;
    if ( y <= n ) arr [ y ] = true;
    int result = 0;
    for ( int i = min ( x, y );
    i <= n;
    i ++ ) {
      if ( arr [ i ] ) {
        if ( i + x <= n ) arr [ i + x ] = true;
        if ( i + y <= n ) arr [ i + y ] = true;
        result ++;
      }
    }
    return result;
  }
question_info.test_list: [{"idx": 0, "outputs": 1, "inputs": {"n": 23, "x": 16, "y": 16}}, {"idx": 1, "outputs": 9, "inputs": {"n": 56, "x": 95, "y": 6}}, {"idx": 2, "outputs": 30, "inputs": {"n": 30, "x": 63, "y": 1}}, {"idx": 3, "outputs": 1, "inputs": {"n": 51, "x": 89, "y": 46}}, {"idx": 4, "outputs": 0, "inputs": {"n": 21, "x": 99, "y": 38}}, {"idx": 5, "outputs": 2, "inputs": {"n": 69, "x": 63, "y": 50}}, {"idx": 6, "outputs": 0, "inputs": {"n": 12, "x": 69, "y": 73}}, {"idx": 7, "outputs": 4, "inputs": {"n": 44, "x": 52, "y": 9}}, {"idx": 8, "outputs": 13, "inputs": {"n": 99, "x": 65, "y": 10}}, {"idx": 9, "outputs": 1, "inputs": {"n": 46, "x": 58, "y": 37}}]
question_info.entry_cls_name: Solution
question_info.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, x: number, y: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n, x, y),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(23, 16, 16, 1);
    console.log(`TEST-0...${result}`);
  
    result = driver(56, 95, 6, 9);
    console.log(`TEST-1...${result}`);
  
    result = driver(30, 63, 1, 30);
    console.log(`TEST-2...${result}`);
  
    result = driver(51, 89, 46, 1);
    console.log(`TEST-3...${result}`);
  
    result = driver(21, 99, 38, 0);
    console.log(`TEST-4...${result}`);
  
    result = driver(69, 63, 50, 2);
    console.log(`TEST-5...${result}`);
  
    result = driver(12, 69, 73, 0);
    console.log(`TEST-6...${result}`);
  
    result = driver(44, 52, 9, 4);
    console.log(`TEST-7...${result}`);
  
    result = driver(99, 65, 10, 13);
    console.log(`TEST-8...${result}`);
  
    result = driver(46, 58, 37, 1);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: countNumbersCanConstructedUsingTwoNumbers
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js