title: Find Sum Modulo K First N Natural Number
signature: function find_sum_modulo_k_first_n_natural_number(n, k)
source_py: def find_sum_modulo_k_first_n_natural_number(N, K):
      ans = 0
      for i in range(1, (N + 1)):
          ans += (i % K)
      return ans
source_cpp: int find_sum_modulo_k_first_n_natural_number(int N, int K) {
    int ans = 0;
    for ( int i = 1;
    i <= N;
    i ++ ) ans += ( i % K );
    return ans;
  }
question_info.entry_fn_name: find_sum_modulo_k_first_n_natural_number
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
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, k, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n, k) 
      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(11, 5, 21)
      print(string.format("TEST-0...%s",result))
  
      result = driver(36, 69, 666)
      print(string.format("TEST-1...%s",result))
  
      result = driver(71, 28, 876)
      print(string.format("TEST-2...%s",result))
  
      result = driver(74, 1, 0)
      print(string.format("TEST-3...%s",result))
  
      result = driver(66, 84, 2211)
      print(string.format("TEST-4...%s",result))
  
      result = driver(38, 14, 237)
      print(string.format("TEST-5...%s",result))
  
      result = driver(2, 11, 3)
      print(string.format("TEST-6...%s",result))
  
      result = driver(73, 87, 2701)
      print(string.format("TEST-7...%s",result))
  
      result = driver(79, 11, 388)
      print(string.format("TEST-8...%s",result))
  
      result = driver(30, 55, 465)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 21, "inputs": {"n": 11, "k": 5}}, {"idx": 1, "outputs": 666, "inputs": {"n": 36, "k": 69}}, {"idx": 2, "outputs": 876, "inputs": {"n": 71, "k": 28}}, {"idx": 3, "outputs": 0, "inputs": {"n": 74, "k": 1}}, {"idx": 4, "outputs": 2211, "inputs": {"n": 66, "k": 84}}, {"idx": 5, "outputs": 237, "inputs": {"n": 38, "k": 14}}, {"idx": 6, "outputs": 3, "inputs": {"n": 2, "k": 11}}, {"idx": 7, "outputs": 2701, "inputs": {"n": 73, "k": 87}}, {"idx": 8, "outputs": 388, "inputs": {"n": 79, "k": 11}}, {"idx": 9, "outputs": 465, "inputs": {"n": 30, "k": 55}}]