Created
March 7, 2017 05:13
-
-
Save yigger/6d07232ac5de457234b2f991e6e94cf2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char findTheDifference(char* s, char* t) { | |
int s_sum = 0; | |
int t_sum = 0; | |
while(*s != '\0') { | |
s_sum += *s; | |
s++; | |
} | |
while(*t != '\0') { | |
t_sum += *t; | |
t++; | |
} | |
return (char)abs(t_sum - s_sum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment