# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + id="fOFacjQBFx9C" colab_type="code" colab={}
class Solution(object):
    def numJewelsInStones(self, J, S):
        """
        :type J: str
        :type S: str
        :rtype: int
        """
        ans=0
        J=set(J)
        for i in S:
            if i in J:
                ans+=1
                
        return ans
    

StarcoderdataJupyterScriptsDedupFiltered