Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 600 Bytes

sort_and_star.md

File metadata and controls

23 lines (18 loc) · 600 Bytes

Description

You will be given a list of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and then return the first value.

The returned value must be a string, and have "***" between each of its letters.

You should not remove or add elements from/to the array.

My Solution

def two_sort(s)
  s.sort.first.chars.join('***')
end

Better/Alternative solution from Codewars

def two_sort(s)
  s.min.chars.join('***')
end