neetcode-gh/leetcode

Output Variable Display Issue in Error Message for Two Sum Problem

Opened this issue · 0 comments

While running the Two Sum problem on the website using Python, I encountered an issue with the error message display. When the output is any other data type instead of a list, the error message fails to correctly display the actual output in one instance.

The relevant error message I received:

Traceback (most recent call last):
  File "/box/script.py", line 57, in main
    raise TypeError(f"Your output was {output}, but the expected return type is List[int]")
TypeError: Your output was (1, 0), but the expected return type is List[int]

Issue Details:

  • In the second last line of the traceback, {output} does not get replaced with the actual output value (1, 0). Instead, it remains as a placeholder {output}.
  • The final line, however, correctly displays the output (1, 0).

Expected Behavior:
The error message should consistently replace {output} with the actual value in both instances for clarity and consistency.

Language: Python
Problem: Two Sum