title: Find Sum Modulo K First N Natural Number
signature: func findSumModuloKFirstNNaturalNumber(n int, k int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, k int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n, k),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(11, 
  	5, 21)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(36, 
  	69, 666)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(71, 
  	28, 876)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(74, 
  	1, 0)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(66, 
  	84, 2211)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(38, 
  	14, 237)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(2, 
  	11, 3)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(73, 
  	87, 2701)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(79, 
  	11, 388)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(30, 
  	55, 465)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }