From 4bf53c9baff8be294c49af0b0653fdb1ebe84eff Mon Sep 17 00:00:00 2001 From: Tiago Collot Date: Mon, 5 Sep 2022 16:48:07 +0100 Subject: [PATCH] feat(piscine-go): add README.md for new go exercise podiumposition --- subjects/podiumposition/README.md | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 subjects/podiumposition/README.md diff --git a/subjects/podiumposition/README.md b/subjects/podiumposition/README.md new file mode 100644 index 00000000..766c3e14 --- /dev/null +++ b/subjects/podiumposition/README.md @@ -0,0 +1,38 @@ +## podiumposition + +### Instructions + +A F1 race just finished and the commentator is calling the finishing positions incorrectly. +Help to fix this before the contestants arrive at the podium by providing the commentator with the correct podium position. + +Write a function `PodiumPosition` that accepts an array of arrays as a `string` and returns the competitor positions correctly. + +### Expected function + +```go +func PodiumPosition(podium[][] string) [][]string { + +} +``` + +### Usage + +Here is a possible program to test your function: + +```go +package main + +import "fmt" + +func main() { + position := [][]string{{"4th Place"}, {"3rd Place"}, {"2nd Place"}, {"1st Place"}} + fmt.Println(PodiumPosition(position)) +} +``` + +And its output: + +```go +$ go run . | cat -e +[[1st Place] [2nd Place] [3rd Place] [4th Place]]$ +```