Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save venelrene/331aa23c303a1afad6256ce600471bb3 to your computer and use it in GitHub Desktop.
Save venelrene/331aa23c303a1afad6256ce600471bb3 to your computer and use it in GitHub Desktop.
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 an…
def lineup_students(names)
names.split.sort_by {|name| [name.length, name] }.reverse
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment