7 kyu
Sort deck of cards
750 of 1,546filipkonieczny
Description:
Write a function sort_cards()
that sorts a shuffled list of cards, so that any given list of cards is sorted by rank, no matter the starting collection.
All cards in the list are represented as strings, so that sorted list of cards looks like this:
['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K']
Example:
>>> sort_cards(['3', '9', 'A', '5', 'T', '8', '2', '4', 'Q', '7', 'J', '6', 'K'])
['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K']
Hint: Tests will have many occurrences of same rank cards, as well as vary in length. You can assume though, that input list is always going to have at least 1 element.
Fundamentals
Algorithms
Lists
Sorting
Similar Kata:
Stats:
Created | Mar 24, 2016 |
Published | Mar 24, 2016 |
Warriors Trained | 2669 |
Total Skips | 48 |
Total Code Submissions | 3898 |
Total Times Completed | 1546 |
Python Completions | 750 |
Java Completions | 322 |
JavaScript Completions | 525 |
Total Stars | 52 |
% of votes with a positive feedback rating | 91% of 310 |
Total "Very Satisfied" Votes | 264 |
Total "Somewhat Satisfied" Votes | 38 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 15 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |