Skip to content

Latest commit

 

History

History
46 lines (26 loc) · 718 Bytes

Sort_and_Star.md

File metadata and controls

46 lines (26 loc) · 718 Bytes

CodeWars Python Solutions


Sort and Star

You will be given an vector of string(s). 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.


Given Code

def two_sort(array):
    pass

Solution 1

def two_sort(array):
    return "***".join([c for c in sorted(array)[0]])

Solution 2

def two_sort(array):
    return "***".join(min(array))

See on CodeWars.com