1 static int wing=[]()
 2 {
 3     std::ios::sync_with_stdio(false);
 4     cin.tie(NULL);
 5     return 0;
 6 }();
 7 
 8 class Solution 
 9 {
10 public:
11     char findTheDifference(string s, string t) 
12     {
13         vector<int> vi(128,0);
14         for(char c:s)
15             vi[c]++;
16         for(char c:t)
17             if(--vi[c]<0)
18                 return c;
19     }
20 };

map或者vector

posted on 2018-05-26 18:41  高数考了59  阅读(94)  评论(0)    收藏  举报