TheAlgorithms-C/leetcode/src/389.c

9 lines
216 B
C
Raw Normal View History

char findTheDifference(char *s, char *t)
{
2019-09-03 23:52:24 +08:00
int sum1 = 0, sum2 = 0;
int i;
for (i = 0; i < strlen(s); i++) sum1 += s[i];
for (i = 0; i < strlen(t); i++) sum2 += t[i];
return (char)(sum2 - sum1);
2019-09-03 23:52:24 +08:00
}