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.
The end index is not included. If you want the last character gone, where should the substring stop?
To stop just BEFORE the last character, the end index is length - 1 (the index of the last character). Try it on "ab": the answer is an empty String.