Add test for detecting question with trailing space

Verify that implementation can detect a question when the string ends
with "? ". Testing the last character in the string without trimming
spaces will fail. This probably breaks some existing submissions.

Also adjusted the example implementation to still pass.