1/**
2 * @param {string} s
3 * @param {string} t
4 * @return {string}
5 */
6
7var findTheDifference = function(s, t) {
8 var t1 = t.split(‘‘).sort();
9 var s1 = s.split(‘‘).sort();
10 for (var i = 0; i < t.length; i++) {
11 if (s1[i] !== t1[i]) {
12 return t1[i];
13 }
14 }
15};
原文:https://www.cnblogs.com/rencoo/p/10137839.html