diff --git a/challenge-1/submissions/Dhar01/solution-template.go b/challenge-1/submissions/Dhar01/solution-template.go new file mode 100644 index 00000000..df2985f4 --- /dev/null +++ b/challenge-1/submissions/Dhar01/solution-template.go @@ -0,0 +1,33 @@ +package main + +import ( + "fmt" + "math" +) + +func main() { + var a, b int + // Read two integers from standard input + _, err := fmt.Scanf("%d, %d", &a, &b) + if err != nil { + fmt.Println("Error reading input:", err) + return + } + + // Call the Sum function and print the result + result := Sum(a, b) + fmt.Println(result) +} + +// Sum returns the sum of a and b. +func Sum(a int, b int) int { + // TODO: Implement the function + lowerLimit := math.Pow(-10, 9) + higherLimit := math.Pow(10, 9) + + if int(lowerLimit) <= a && b <= int(higherLimit) { + return a + b + } + + return 0 +}