You are given a string jewels listing the stone types that are jewels, and a string stones listing the stones you have. Each character is one type of stone, and letters are case sensitive. Return how many of your stones are jewels.
You are given a string jewels listing the stone types that are jewels, and a string stones listing the stones you have. Each character is one type of stone, and letters are case sensitive. Return how many of your stones are jewels.
Example 1:
Input: {"jewels":"aA","stones":"aAAbbbb"}
Output: 3
Constraints:
1≤jewels.length,stones.length≤50
jewels and stones consist of only English letters.
All the characters of jewels are unique.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"jewels":"aA","stones":"aAAbbbb"}
Jewel types are "aA". Count how many of the 7 stones in "aAAbbbb" are one of them (case matters).