#3664
Two-Letter Card Game
expert · 1245 · lc medium +32 · 12.3% accepted · 120 likes · top 0%
Description
A deck of two-letter cards (cards) and a letter x are given. On each turn, pick two compatible cards that both contain x, remove them, and earn 1 point. Two cards are compatible when their strings differ in exactly one position. Play optimally to maximize points. Return that maximum.
Code
1
2
3