Kodewick
Start learning →
Starter←→0 / 70

Sharing sweets

#043StarterFunctions2 min

sweets sweets are shared evenly between kids children (at least 1). Write Share(sweets, kids) to return two numbers at once: how many each child gets, and how many are left over.

Examples
Share(17, 5)→(3, 2)
Share(10, 2)→(5, 0)
The functionfunc Share(sweets, kids int) (int, int)
main.go
package main

func Share(sweets, kids int) (int, int) {
	// your code here: return each share and the leftover together
	return 0, 0
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.