Very simple bug:
for(int i = 0; i < original.length(); i++) { char c = tolower(test[i]); // Should be original[i] instead of test[i] freqOrig[c]++; }
Change tolower(test[i]) to tolower(original[i])
tolower(test[i])
tolower(original[i])
2.1m questions
2.1m answers
60 comments
57.0k users