Jewels and Stones

Jewels and Stones

You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels.

Letters are case sensitive, so "a" is considered a different type of stone from "A". 

Example 1:

Input: jewels = "aA", stones = "aAAbbbb"
Output: 3


টুলস

- হ্যাশম্যাপ

পদ্বতি

- একটা হ্যাশম্যাপ নিয়ে তার মধ্যে jewels কে ক্যারেক্টার হিসাবে যুক্ত করতে হবে
- stones এর ক্যারাক্টার গুলাকে দিয়ে লুপ চালাতে হবে 
  • চেক করতে হবে লুপ এর ক্যারাক্টার হ্যাশমাপ এর আছ কিনা 
  • থাকে কাউন্ট বাড়াতে হবে এবং লুপ শেষ করতে হবে 

Share