7 kyu
Alphabetize a list by the nth character
908 of 2,036edm2410
Description:
Write a function that accepts two parameters, i) a string (containing a list of words) and ii) an integer (n). The function should alphabetize the list based on the nth letter of each word.
The letters should be compared case-insensitive. If both letters are the same, order them normally (lexicographically), again, case-insensitive.
Example:
sort_it('bid, zag', 2) #=> 'zag, bid'
The length of all words provided in the list will be >= n. The format will be "x, x, x". In Haskell you'll get a list of String
s instead.
Lists
Strings
Sorting
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Feb 26, 2015 |
Published | Feb 26, 2015 |
Warriors Trained | 4582 |
Total Skips | 460 |
Total Code Submissions | 15068 |
Total Times Completed | 2036 |
JavaScript Completions | 767 |
Ruby Completions | 315 |
Python Completions | 908 |
Haskell Completions | 93 |
Total Stars | 60 |
% of votes with a positive feedback rating | 79% of 305 |
Total "Very Satisfied" Votes | 219 |
Total "Somewhat Satisfied" Votes | 45 |
Total "Not Satisfied" Votes | 41 |