From 3e64e028d824f2f08a1f61402a62fbbf4de67dc7 Mon Sep 17 00:00:00 2001 From: Tiago Collot Date: Wed, 31 Aug 2022 10:41:08 +0100 Subject: [PATCH] feat(pisicine-go): add README.md for new exercise shoppinglistsort --- subjects/shoppinglistsort/README.md | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 subjects/shoppinglistsort/README.md diff --git a/subjects/shoppinglistsort/README.md b/subjects/shoppinglistsort/README.md new file mode 100644 index 00000000..832a7215 --- /dev/null +++ b/subjects/shoppinglistsort/README.md @@ -0,0 +1,37 @@ +# shoppinglistsort + +### Instructions + +You were sent to the supermarket with a shopping list. To make your shopping faster, write a function `ShoppingListSort()` that takes an array of strings and sorts it, according to the string length, returning an array in which the strings appear in ascending order. + +In the case of equal string length the order does not matter. + +### Expected function + +```go +func ShoppingListSort(array[] string)[]string { + +} +``` + +### Usage + +Here is a possible program to test your function: + +```go +package main + +import "fmt" + +func main() { + array:= []string{"Banana", "Mushroom", "Salt", "Pepper","Tea", "Milk"} + fmt.Println(ShoppingListSort(array)) +} +``` + +And its output: + +```go +$ go run . | cat -e +[Tea Salt Milk Banana Pepper Mushroom]$ +```