Skip to content

Commit e3529e5

Browse files
committed
Show Finished in run code result
The Leetcode website cannot distinguish accepted answers from wrong answers. Instead, it shows Finished.
1 parent 3cce6e2 commit e3529e5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

autoload/leetcode.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ def _check_result(submission_id):
306306
result['stdout'] = _split(r.get('std_output', ''))
307307
result['runtime_percentile'] = r.get('runtime_percentile', '')
308308
else:
309+
# Test states cannot distinguish accepted answers from wrong answers.
310+
if result['state'] == 'Accepted':
311+
result['state'] = 'Finished'
309312
result['stdout'] = r.get('code_output', [])
310313
result['expected_answer'] = []
311314
result['runtime_percentile'] = r.get('runtime_percentile', '')

autoload/leetcode.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ function! s:ShowRunResultInPreview(result) abort
920920

921921
" add custom syntax rules
922922
syn keyword lcAccepted Accepted
923+
syn keyword lcAccepted Finished
923924
syn match lcFailure /Wrong Answer/
924925
syn match lcFailure /Memory Limit Exceeded/
925926
syn match lcFailure /Output Limit Exceeded/

0 commit comments

Comments
 (0)