Retired
Format a string of names like 'Bart, Lisa & Maggie'. (retired)
36,199 of 71,234weavermedia
Description:
Given: an array containing hashes of names
Return: a string formatted as a list of names separated by commas except for the last two names, which should be separated by an ampersand.
Example:
list([ {name: 'Bart'}, {name: 'Lisa'}, {name: 'Maggie'} ])
// returns 'Bart, Lisa & Maggie'
list([ {name: 'Bart'}, {name: 'Lisa'} ])
// returns 'Bart & Lisa'
list([ {name: 'Bart'} ])
// returns 'Bart'
list([])
// returns ''
Note: all the hashes are pre-validated and will only contain A-Z, a-z, '-' and '.'.
Fundamentals
Strings
Data Types
Formatting
Algorithms
Logic
Similar Kata:
Stats:
Created | Mar 29, 2014 |
Warriors Trained | 150164 |
Total Skips | 23165 |
Total Code Submissions | 327244 |
Total Times Completed | 71234 |
Ruby Completions | 5063 |
JavaScript Completions | 36199 |
Python Completions | 29779 |
Elixir Completions | 428 |
Total Stars | 1380 |
% of votes with a positive feedback rating | 88% of 7092 |
Total "Very Satisfied" Votes | 5480 |
Total "Somewhat Satisfied" Votes | 1483 |
Total "Not Satisfied" Votes | 129 |