GO challenges - solve me first problem

Posted on Apr 08, 2019   ∣  1 min read  ∣  GO challenges

Problem

HackerRank

Complete the function solveMeFirst to compute the sum of two integers.

Function prototype:

int solveMeFirst(int a, int b);

where,

Sample Input:

a = 2
b = 3

Sample Output:

Explanation The sum of the two integers aand bis computed as:2 + 3 = 5

Solution:

package main
import "fmt"

func solveMeFirst(a uint32,b uint32) uint32{
  // Hint: Type return (a+b) below

  return a + b
}

func main() {
    var a, b, res uint32
    fmt.Scanf("%v\n%v", &a,&b)
    res = solveMeFirst(a,b)
    fmt.Println(res)
}