finds; the letter names the kind of stone. The string precious lists the valuable kinds, each exactly once.
Return how many finds are of a precious kind. Case matters: a and A are different kinds.precious="gR", finds="rgGRgx" → 3
The precious kinds are g and R. The finds hold two g and one R; r and G are different kinds. That makes 3.
precious="q", finds="QQQ" → 0
Case matters: Q is not q, so nothing found is precious.
precious are distinctprecious="gR", finds="rgGRgx"
3
Run checks the first 3 tests in your browser. Submit checks all 90 tests on the server, hidden ones included.