5 kyu

Sorting Poker

146 of 384myjinxin2015

Description:

When no more interesting kata can be resolved, I just choose to create the new kata, to solve their own, to enjoy the process --myjinxin2015 said

Description:

John learns to play poker with his uncle. His uncle told him: Poker to be in accordance with the order of "2 3 4 5 6 7 8 9 10 J Q K A". The same suit should be put together. But his uncle did not tell him the order of the four suits.

Give you John's cards and Uncle's cards(two string john and uncle). Please reference to the order of Uncle's cards, sorting John's cards.

Examples

john = '♦6♥2♠3♦5♠J♣Q♠K♣7♦2♣5♥5♥10♠A'
uncle = '♠2♠3♠5♥J♥Q♥K♣8♣9♣10♦4♦5♦6♦7'
return '♠3♠J♠K♠A♥2♥5♥10♣5♣7♣Q♦2♦5♦6'

john = '♦6♥2♠3♦5♠J♣Q♠K♣7♦2♣5♥5♥10♠A'
uncle = '♣8♣9♣10♦4♦5♦6♦7♠2♠3♠5♥J♥Q♥K'
return '♣5♣7♣Q♦2♦5♦6♠3♠J♠K♠A♥2♥5♥10'
Puzzles
Algorithms
Sorting

Stats:

CreatedOct 25, 2016
PublishedOct 25, 2016
Warriors Trained1042
Total Skips61
Total Code Submissions1743
Total Times Completed384
JavaScript Completions146
C# Completions52
F# Completions19
Python Completions187
Total Stars21
% of votes with a positive feedback rating92% of 116
Total "Very Satisfied" Votes100
Total "Somewhat Satisfied" Votes14
Total "Not Satisfied" Votes2
Total Rank Assessments5
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • kazk Avatar
  • Ze-Marcos Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • mauro-1 Avatar
Ad