← all problems

Fix trimEnds 🌶️🌶️

The method below is supposed to return s without its first and last character, so "(hello)" gives "hello" (assume s has at least two characters). It compiles, but it does not work: it cuts off too much, and it throws on the shortest input. Find the bug and fix it. Run the tests and read each result: a wrong value and an exception are different clues.