mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
817 B
39 lines
817 B
2 years ago
|
## 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]]$
|
||
|
```
|