Jewels and Stones

EasyHash TableString

Solution

export function numJewelsInStones(jewels: string, stones: string): number {
  const jewel = new Set(jewels);
  return [...stones].filter((stone) => jewel.has(stone)).length;
}