From 4d13d88fa796b2f3109068be4f54f97b58a91a5f Mon Sep 17 00:00:00 2001 From: Tiago Collot Date: Thu, 29 Sep 2022 18:19:08 +0100 Subject: [PATCH] docs(shoppinglistsort): fix subject information --- subjects/shoppinglistsort/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subjects/shoppinglistsort/README.md b/subjects/shoppinglistsort/README.md index 14506441..7c1df34a 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]$ ```