7 kyu
Determine if the poker hand is flush
124 of 6,266CodingWarrior
Description:
Determine if the poker hand is flush, meaning if the five cards are of the same suit.
Your function will be passed a list/array of 5 strings, each representing a poker card in the format "5H"
(5 of hearts), meaning the value of the card followed by the initial of its suit (H
earts, S
pades, D
iamonds or C
lubs). No jokers included.
Your function should return true
if the hand is a flush, false
otherwise.
The possible card values are 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A
Examples
["AS", "3S", "9S", "KS", "4S"] ==> true
["AD", "4S", "7H", "KS", "10S"] ==> false
Arrays
Algorithms
Logic
Strings
Games
Similar Kata:
Stats:
Created | Apr 9, 2018 |
Published | Apr 10, 2018 |
Warriors Trained | 8442 |
Total Skips | 113 |
Total Code Submissions | 16642 |
Total Times Completed | 6266 |
C# Completions | 489 |
Java Completions | 934 |
PHP Completions | 321 |
Python Completions | 2656 |
Ruby Completions | 196 |
Haskell Completions | 81 |
JavaScript Completions | 1683 |
Scala Completions | 124 |
CoffeeScript Completions | 9 |
Total Stars | 83 |
% of votes with a positive feedback rating | 94% of 777 |
Total "Very Satisfied" Votes | 697 |
Total "Somewhat Satisfied" Votes | 70 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 5 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |