4 ms·
The scoring poker is indeed an interesting problem - and its Project Euler #54 ( https://projecteuler.net/problem=54 https://projecteuler.net/problem=54 ) Star
by shagie 5y ago
The scoring poker is indeed an interesting problem - and its Project Euler #54 ( https://projecteuler.net/problem=54 https://projecteuler.net/problem=54 )
Starting from high card on gets to some interesting increasingly complex "can I identify it rules"
- maerF0x0 5y agoI actually ran the interview on some coworkers for fun (they volunteered) and it was interesting to see the more senior (& IMO brighter) folks quickly recognize code reuse. !@! SPOILER BELOW !@! !@! SPOILER BELOW !@! high card -> sort cards by value return cards[4] Count cards (map[value]->int) --> Pair, pairs, triples, four of a kind For each card is first token match? --> flush sort cards , card[0] == card[4] + 4? --> straight straight flush --> straight && flush royal flush --> highcard == A && straight && flush
- deleted 5y ago[deleted]