Skip to content
This repository was archived by the owner on May 3, 2020. It is now read-only.

Latest commit

 

History

History
18 lines (11 loc) · 527 Bytes

File metadata and controls

18 lines (11 loc) · 527 Bytes

csssr-task

Description

Given a string of words separated by spaces. You have to transform this string into a data structure that groups these words by their first letters.

The groups should be sorted in alphabetical order. Inner words should be sorted by their lengths and also in alphabetical order if the lengths are equal.

Example

before = "сапог сарай арбуз болт бокс биржа"

// transform
. . .

after = "[б=[биржа, бокс, болт], c=[caпог, сарай]]"