Update README.md
This commit is contained in:
parent
317ad0027c
commit
24d42fe123
1 changed files with 19 additions and 0 deletions
19
README.md
19
README.md
|
|
@ -1,5 +1,24 @@
|
||||||
# Group and Sort Array Items
|
# Group and Sort Array Items
|
||||||
|
|
||||||
|
## Question
|
||||||
|
|
||||||
|
[Sloth Bytes | 2024-07-09](https://slothbytes.beehiiv.com/p/tech-stacks?utm_source=slothbytes.beehiiv.com&utm_medium=newsletter&utm_campaign=does-tech-stack-matter)
|
||||||
|
|
||||||
|
```
|
||||||
|
Advanced List Sort
|
||||||
|
Create a function that takes a list of numbers or strings and returns a list with the items from the original list stored into sub lists. Items of the same value should be in the same sub list.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
advanced_sort([2, 1, 2, 1]) ➞ [[2, 2], [1, 1]]
|
||||||
|
|
||||||
|
advanced_sort([5, 4, 5, 5, 4, 3]) ➞ [[5, 5, 5], [4, 4], [3]]
|
||||||
|
|
||||||
|
advanced_sort(["b", "a", "b", "a", "c"]) ➞ [["b", "b"], ["a", "a"], ["c"]]
|
||||||
|
|
||||||
|
Notes
|
||||||
|
The sub lists should be returned in the order of each element's first appearance in the given list.
|
||||||
|
```
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
This utility takes a user input of numbers or strings (or both), groups them based on their value, and then sorts these group in order.
|
This utility takes a user input of numbers or strings (or both), groups them based on their value, and then sorts these group in order.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue