I was trying out a problem, and my code failed one of its test cases. I traced back the error, and it can be summarized by the following code: