7 kyu

Suzuki needs help lining up his students!

1,136 of 3,387user8476848

Description:

Suzuki needs help lining up his students!

Today Suzuki will be interviewing his students to ensure they are progressing in their training. He decided to schedule the interviews based on the length of the students name in descending order. The students will line up and wait for their turn.

You will be given a string of student names. Sort them and return a list of names in descending order.

Here is an example input:

string = 'Tadashi Takahiro Takao Takashi Takayuki Takehiko Takeo Takeshi Takeshi'

Here is an example return from your function:

 lst = ['Takehiko',
        'Takayuki',
        'Takahiro',
        'Takeshi',
        'Takeshi',
        'Takashi',
        'Tadashi',
        'Takeo',
        'Takao']

Names of equal length will be returned in reverse alphabetical order (Z->A) such that:

string = "xxa xxb xxc xxd xa xb xc xd"

Returns

['xxd', 'xxc', 'xxb', 'xxa', 'xd', 'xc', 'xb', 'xa']

Please also try the other Kata in this series..

Strings
Sorting
Fundamentals

Stats:

CreatedApr 3, 2016
PublishedApr 3, 2016
Warriors Trained6859
Total Skips229
Total Code Submissions16678
Total Times Completed3387
Python Completions1136
Ruby Completions284
JavaScript Completions1269
Crystal Completions10
Java Completions463
C# Completions240
Factor Completions10
CoffeeScript Completions9
Scala Completions29
TypeScript Completions86
COBOL Completions4
Total Stars116
% of votes with a positive feedback rating90% of 542
Total "Very Satisfied" Votes457
Total "Somewhat Satisfied" Votes67
Total "Not Satisfied" Votes18
Ad
Contributors
  • user8476848 Avatar
  • SagePtr Avatar
  • GiacomoSorbi Avatar
  • CrazyMerlyn Avatar
  • bidouille Avatar
  • hobovsky Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • tri@ Avatar
  • Just4FunCoder Avatar
  • farhanaditya Avatar
  • KayleighWasTaken Avatar
  • LosBlobbos Avatar
  • saudiGuy Avatar
Ad