# leetcode389

1、Find the Difference
Given two strings s and t which consist of only lowercase letters.

String t is generated by random shuffling string s and then add one more letter at a random position.

Find the letter that was added in t.

Example:

Input:
s = “abcd”
t = “abcde”

Output:
e

Explanation:
‘e’ is the letter that was added.

class Solution {
public:
char findTheDifference(string s, string t) {
int sum=0,sum1=0;
for(int i=0;i<s.length();i++){
sum=sum+s[i];
}
for(int i=0;i<t.length();i++){
sum1=sum1+t[i];
}
return sum1-sum;
}
};

#### leetcode389: Find the Difference,

2016-10-23 11:02:50

#### LeetCode : 389. Find the Difference

2016-08-29 17:02:16

#### LeetCode389. Find the Difference

2016-08-29 10:26:26

#### [leetcode] 389. Find the Difference 解题报告

2016-08-29 14:10:50

#### leetcode_389 Find the Difference

2016-08-29 20:37:18

#### leetcode389 Find the Difference java

2017-03-04 10:49:00

#### leetcode算法——389. Find the Difference(基于JAVA)

2016-09-06 11:48:56

#### leetcode389[easy]---Find the Difference

2017-12-04 16:23:14

#### 算法系列（8）LeetCode389

2017-11-26 21:54:00