SyntaxFix
Write A Post
Hire A Developer
Questions
You are iterating over one string (word), but then using the index into that to look up a character in so_far. There is no guarantee that these two strings have the same length.
word
so_far