title: Leonardo Number 1
signature: function leonardo_number_1(n)
test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(n, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(75, 6832909245813413)
      print(string.format("TEST-0...%s",result))
  
      result = driver(76, 11055879401769513)
      print(string.format("TEST-1...%s",result))
  
      result = driver(55, 451702867433)
      print(string.format("TEST-2...%s",result))
  
      result = driver(14, 1219)
      print(string.format("TEST-3...%s",result))
  
      result = driver(43, 1402817465)
      print(string.format("TEST-4...%s",result))
  
      result = driver(10, 177)
      print(string.format("TEST-5...%s",result))
  
      result = driver(16, 3193)
      print(string.format("TEST-6...%s",result))
  
      result = driver(30, 2692537)
      print(string.format("TEST-7...%s",result))
  
      result = driver(44, 2269806339)
      print(string.format("TEST-8...%s",result))
  
      result = driver(65, 55555780070575)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
source_py: def leonardo_number_1(n):
      dp = []
      dp.append(1)
      dp.append(1)
      for i in range(2, (n + 1)):
          dp.append(((dp[(i - 1)] + dp[(i - 2)]) + 1))
      return dp[n]
source_cpp: int leonardo_number_1(int n) {
    int dp [ n + 1 ];
    dp [ 0 ] = dp [ 1 ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] + 1;
    return dp [ n ];
  }