Skip to content

ekhodzitsky/proud_of

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Тестовые задания


csssr

Задание от компании csssr:

У нас есть строка со словами, разделенными пробелом. Нужно разбить слова в строке на группы по первой букве слова, причем группы слов должны состоять более чем из одного слова. Группы слов должны идти в алфавитном порядке, а слова в группе должны быть отсортированы по количеству букв в слове. Если количество букв в словах одинаковое, сортировать по алфавиту. Например:

  • input: ШАР ДОМ ПРЕЗИДЕНТ БОРИС ЛИТЕРАТУРА ИСТИНА БОДРЫЙ КРУГЛЫЙ БОБЁР КВАДРАТНЫЙ
  • output: БОБЁР БОРИС БОДРЫЙ КВАДРАТНЫЙ КРУГЛЫЙ

There is a string consisting of words. All words in it are separated by one space. You need to convert the string into a data structure that groups words by the first letter of the word. Then output only the groups containing more than one element. Groups should be sorted alphabetically by all letters in the word. Words within the group should be sorted in descending order (by the number of characters); if the number of characters is equal, then sort in alphabetical order.

Решение и JUnit тесты в соответствующей папке репозитория.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages