10.Jewels and Stones
You're given strings J
representing the types of stones that are jewels, and S
representing the stones you have. Each character in S
is a type of stone you have. You want to know how many of the stones you have are also jewels.
Solution : (Using Hashset)
Time Complexity: O(n), Space Complexity: O(n)
Last updated