Fruit salads are served best when the fruits are sliced and diced into small chunks!
For this challenge, slice each fruit in half and sort the chunks alphabetically. This recipe tastes best when the chunks are joined together to make a string.
fruit_salad(['apple', 'pear', 'grapes']) β 'apargrapepesple'
# Chunks: ['ap', 'ple', 'pe', 'ar', 'gra', 'pes']
# Sorted chunks: ['ap', 'ar', 'gra', 'pe', 'pes', 'ple']
# Final string: 'apargrapepesple'
fruit_salad(['apple', 'pear', 'grapes']) β 'apargrapepesple'
fruit_salad(['raspberries', 'mango']) β 'erriesmangoraspb'
fruit_salad(['banana']) β 'anaban'
- If a fruit has an odd number of letters, make the right side larger than the left.
For example:
'apple'
will be sliced into'ap'
and'ple'
. - All fruits will be given in lowercase.