【LeetCode】解析_771.Jewels and Stones

珠寶與石頭 參考及出處:LeetCode

(懶人解題)不考慮時間複雜度->

 public static int GetJewelNum(string J,string P)
        {            
            int num = 0;
            for (int i = 0; i < P.Length; i++)
            {
                for (int j = 0; j < J.Length; j++)
                {
                    if (J[j] == P[i])
                    {
                        num++;
                    }
                }
            }
            return num;
        }