ianding1 / leetcode.vim

Solve LeetCode problems in Vim!
MIT License
308 stars 43 forks source link

How to check :LeetCodeTest result? #33

Closed ywpkwon closed 4 years ago

ywpkwon commented 4 years ago

I tried the problem "String to Integer (atoi)" and I wanted to test a dummy code as below.

class Solution:
    def myAtoi(self, str: str) -> int:
        print('xx')
        return 0

LeetCode webpage is supposed to show:

Wrong answer
Your input  "42"
stdout        xx
Output       0
Expected   42

However, What I'm seeing in (neo)vim is just:

# Test Input
"42"

Is this right? What info is the plugin supposed to show? Is my setting wrong?

ianding1 commented 4 years ago

Hi @ywpkwon

Type :wq to submit the test or :q! to abort.

When you run :LeetCodeTest, leetcode.vim will pop up a window containing the default test input or the test input that you used the last time. For example, the default test input of the String to Integer problem is "42".

You can put any input here, as long as it's valid for the problem. Say you want to test if your program works for "1234", you can replace the original text with "1234".

ywpkwon commented 4 years ago

Ah, I didn't know there is an additional step (:wq). It seems to work well. Thanks, @ianding1!