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 (Hearts, Spades, Diamonds or Clubs). 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

Stats:

CreatedApr 9, 2018
PublishedApr 10, 2018
Warriors Trained8442
Total Skips113
Total Code Submissions16642
Total Times Completed6266
C# Completions489
Java Completions934
PHP Completions321
Python Completions2656
Ruby Completions196
Haskell Completions81
JavaScript Completions1683
Scala Completions124
CoffeeScript Completions9
Total Stars83
% of votes with a positive feedback rating94% of 777
Total "Very Satisfied" Votes697
Total "Somewhat Satisfied" Votes70
Total "Not Satisfied" Votes10
Total Rank Assessments5
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • CodingWarrior Avatar
  • Jotha Avatar
  • suic Avatar
  • anter69 Avatar
  • JohanWiltink Avatar
  • Edison2ST Avatar
  • suarezali75 Avatar
  • GianfriAur Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad