From aa08580a4d6441951b4f2d7def1b53ed624c284b Mon Sep 17 00:00:00 2001 From: Tiago Collot Date: Thu, 1 Sep 2022 14:52:37 +0100 Subject: [PATCH] feat(piscine-go): add README.md for new go exercise reversemenuindex --- subjects/reversemenuindex/README.md | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 subjects/reversemenuindex/README.md diff --git a/subjects/reversemenuindex/README.md b/subjects/reversemenuindex/README.md new file mode 100644 index 000000000..b3a099e5c --- /dev/null +++ b/subjects/reversemenuindex/README.md @@ -0,0 +1,38 @@ +## reversemenuindex + +### Instructions + +The restaurant employees are having a really tough day and are delivering the customers' food in the wrong order. You need to fix the problem so that they can deliver it correctly. + +Write a function `ReverseMenuIndex` that takes an array of strings as arguments and returns another array of strings with the menu in the correct order. + +- `append` is not allowed for this exercise. + +### Expected function + +```go +func ReverseMenuIndex(menu []string) []string { + +} +``` + +### Usage + +Here is a possible program to test your function: + +```go +package main + +import "fmt" + +func main() { + fmt.Println(ReverseMenuIndex([]string{"desserts", "mains", "drinks", "starters"})) +} +``` + +And its output: + +```go +$ go run . | cat -e +[starters drinks mains desserts]$ +```