diff --git a/subjects/shoppinglistsort/README.md b/subjects/shoppinglistsort/README.md index 145064413..7c1df34a9 100644 --- a/subjects/shoppinglistsort/README.md +++ b/subjects/shoppinglistsort/README.md @@ -2,14 +2,14 @@ ### 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. +You were sent to the supermarket with a shopping list. To make your shopping faster, write a function `ShoppingListSort()` that takes a slice of strings and sorts it, according to the string length, returning a slice in which the strings appear in ascending order. When the length of string elements are equal, then the order in which they appear does not matter. ### Expected function ```go -func ShoppingListSort(array[] string)[]string { +func ShoppingListSort(slice []string) []string { } ``` @@ -22,19 +22,19 @@ Here is a possible program to test your function: package main import ( - "fmt" - "piscine" + "fmt" + "piscine" ) func main() { - array:= []string{"Banana", "Mushroom", "Salt", "Pepper","Tea", "Milk"} - fmt.Println(piscine.ShoppingListSort(array)) + slice := []string{"Banana", "Mushroom", "Salt", "Pepper","Tea", "Milk"} + fmt.Println(piscine.ShoppingListSort(slice)) } ``` And its output: -```go +```console $ go run . | cat -e [Tea Salt Milk Banana Pepper Mushroom]$ ```