In this lesson we will introduce you to how coding challenges work and how to make the most out of them.
Sum of Two Numbers
You are given two numbers a and b. Return their sum.
Example:
Input: a = 4, b = 9 Output: 13 Explanation: The sum ofaandbis 4 + 9, which is 13.
The function
In Go, the starter code gives you a function with parameters. The parameters represent the challenge input:
func sum(a int, b int) int {
// Your code goes here
}
The int after the parameter list means the function must return an integer.
For this challenge, return a + b.
Assignment
Follow the Coding Tutorial and return the sum of the two inputs.
Free plan: 30 tutor messages. PRO is unlimited.
