From 9428031c4d1652ed1cbff50e8dd4d07152dc2dd9 Mon Sep 17 00:00:00 2001 From: VicRen Date: Mon, 14 Dec 2020 14:15:04 +0800 Subject: [PATCH] update euler 54 --- 54_poker_hands/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/54_poker_hands/main.go b/54_poker_hands/main.go index d3aed26..8cc2ba7 100644 --- a/54_poker_hands/main.go +++ b/54_poker_hands/main.go @@ -74,3 +74,13 @@ func (c card) suit() string { } type cards [5]card + +func (c cards) isSampleSuit() bool { + s := c[0].suit() + for _, card := range c { + if card.suit() != s { + return false + } + } + return true +}