Implement Card Purchase With Gem Costs and Hand-Based Color Discounts

Asked at Brex · Coding Questions · Difficulty: Medium

Implement `canPurchase(player, card)`: return `true` if the player has enough gems to pay the card's cost, otherwise `false`.

Loading the problem…