Skip to content

Commit f61ad97

Browse files
dpkatzkaiwk
authored andcommitted
Add reporting for Memory Limit Exceeded errors (status 12)
For `leetcode--show-submission-result` we're not showing status if there's a Memory Limit Exceeded error (status 12). This can happen, for example, if a submission in Python hits the Python recursion depth limit. When it happens, nothing is displayed in the submission result buffer at all. In this change, we add some handling to deal with this error for the submission results.
1 parent 02eb6ff commit f61ad97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

leetcode.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ STATUS_CODE has following possible value:
10801080
10811081
- 10: Accepted
10821082
- 11: Wrong Anwser
1083+
- 12: Memory Limit Exceeded
10831084
- 14: Time Limit Exceeded
10841085
- 15: Runtime Error. full_runtime_error
10851086
- 20: Compile Error. full_compile_error"
@@ -1107,6 +1108,10 @@ STATUS_CODE has following possible value:
11071108
(insert (format "Expected Answer: %s\n\n" .expected_output))
11081109
(unless (string-empty-p .std_output)
11091110
(insert (format "Stdout: \n%s\n" .std_output))))
1111+
((eq .status_code 12)
1112+
(insert (format "Status: %s" (leetcode--add-font-lock .status_msg 'leetcode-error-face)))
1113+
(insert (format "\n\n%s / %s testcases passed\n" .total_correct .total_testcases))
1114+
(insert (format "Last Test Case: %s\n" .last_testcase)))
11101115
((eq .status_code 14)
11111116
(insert (format "Status: %s" (leetcode--add-font-lock .status_msg 'leetcode-error-face)))
11121117
(insert (format "\n\n%s / %s testcases passed\n" .total_correct .total_testcases))

0 commit comments

Comments
 (0)