title: Sum Fibonacci Numbers
signature: function sum_fibonacci_numbers(n)
source_py: def sum_fibonacci_numbers(n):
      if (n <= 0):
          return 0
      fibo = ([0] * (n + 1))
      fibo[1] = 1
      sm = (fibo[0] + fibo[1])
      for i in range(2, (n + 1)):
          fibo[i] = (fibo[(i - 1)] + fibo[(i - 2)])
          sm = (sm + fibo[i])
      return sm
source_cpp: int sum_fibonacci_numbers(int n) {
    if ( n <= 0 ) return 0;
    int fibo [ n + 1 ];
    fibo [ 0 ] = 0, fibo [ 1 ] = 1;
    int sum = fibo [ 0 ] + fibo [ 1 ];
    for ( int i = 2;
    i <= n;
    i ++ ) {
      fibo [ i ] = fibo [ i - 1 ] + fibo [ i - 2 ];
      sum += fibo [ i ];
    }
    return sum;
  }
question_info.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(9, 88)
      print(string.format("TEST-0...%s",result))
  
      result = driver(50, 32951280098)
      print(string.format("TEST-1...%s",result))
  
      result = driver(7, 33)
      print(string.format("TEST-2...%s",result))
  
      result = driver(21, 28656)
      print(string.format("TEST-3...%s",result))
  
      result = driver(21, 28656)
      print(string.format("TEST-4...%s",result))
  
      result = driver(11, 232)
      print(string.format("TEST-5...%s",result))
  
      result = driver(25, 196417)
      print(string.format("TEST-6...%s",result))
  
      result = driver(62, 10610209857722)
      print(string.format("TEST-7...%s",result))
  
      result = driver(4, 7)
      print(string.format("TEST-8...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 88, "inputs": {"n": 9}}, {"idx": 1, "outputs": 32951280098, "inputs": {"n": 50}}, {"idx": 2, "outputs": 33, "inputs": {"n": 7}}, {"idx": 3, "outputs": 28656, "inputs": {"n": 21}}, {"idx": 4, "outputs": 28656, "inputs": {"n": 21}}, {"idx": 5, "outputs": 232, "inputs": {"n": 11}}, {"idx": 6, "outputs": 196417, "inputs": {"n": 25}}, {"idx": 7, "outputs": 10610209857722, "inputs": {"n": 62}}, {"idx": 8, "outputs": 7, "inputs": {"n": 4}}]
question_info.extension: lua
question_info.entry_fn_name: sum_fibonacci_numbers
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8
question_info.commands: lua __FILENAME__