Browse Source

docs(shoppinglistsort): fix subject information

pull/1541/head
Tiago Collot 2 years ago
parent
commit
4d13d88fa7
  1. 10
      subjects/shoppinglistsort/README.md

10
subjects/shoppinglistsort/README.md

@ -2,14 +2,14 @@
### Instructions ### 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. When the length of string elements are equal, then the order in which they appear does not matter.
### Expected function ### Expected function
```go ```go
func ShoppingListSort(array[] string)[]string { func ShoppingListSort(slice []string) []string {
} }
``` ```
@ -27,14 +27,14 @@ import (
) )
func main() { func main() {
array:= []string{"Banana", "Mushroom", "Salt", "Pepper","Tea", "Milk"} slice := []string{"Banana", "Mushroom", "Salt", "Pepper","Tea", "Milk"}
fmt.Println(piscine.ShoppingListSort(array)) fmt.Println(piscine.ShoppingListSort(slice))
} }
``` ```
And its output: And its output:
```go ```console
$ go run . | cat -e $ go run . | cat -e
[Tea Salt Milk Banana Pepper Mushroom]$ [Tea Salt Milk Banana Pepper Mushroom]$
``` ```

Loading…
Cancel
Save