Browse Source

docs(shoppinglistsort): fix subject information

1153-word-abbreviate
Tiago Collot 2 years ago
parent
commit
4d13d88fa7
  1. 14
      subjects/shoppinglistsort/README.md

14
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]$
```

Loading…
Cancel
Save