. You’re given strings J representing the types ofstones that are jewels, and S representing the stones you have.Each character in Sis a type of stone you have. You want to knowhow many of the stones you have are also jewels.
The letters in J are guaranteed distinct, and all characters in Jand S are letters. Letters are case sensitive, so “a” is considereda different type of stone from “A”.
Example 1:
Input: J = “aA”, S = “aAAbbbb”
Output: 3
Example 2:
Input: J = “z”, S = “ZZ”
Output: 0
Expert Answer
An answer will be send to you shortly. . . .
PayPal Gateway not configured
PayPal Gateway not configured