ianding1 / leetcode.vim

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

Change 'submit' vs 'run code' response parsing conditional from judge_type to submission_id startswith 'runcode_' #61

Open Galus opened 3 years ago

Galus commented 3 years ago

I am unsure if this was intended behavior, but I am unable to currently run 'LeetCodeTest' and get a 'Run Code' / 'test' submission. I am only able to run 'LeetCodeSubmit' and get back some output. After a while, I noticed the output was missing std_output for debugging. I found in the code that we chose to branch on judge_type == 'large'... I am thinking it would be better to branch on submission_id since they are uniquely formatted between Submit and Run Code.

Maybe someone can help me get my LeetCodeTest to run correctly?

INPUT:

impl Solution {
    pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {

        println!("nums: {:?}", nums);
        println!("target: {}", target);
        for x in 0..nums.len() {
            println!("{}", x)
        }

        vec![0, 23333]
    }
}

Example output after proposed change of LeetCodeSubmit

# Two Sum

## State
  - Wrong Answer

## Runtime
  - N/A

## Test Cases
  - Passed: 0
  - Total:  29
  - WARNING: some test cases failed

## Standard Output
    nums: [2, 7, 11, 15]
    target: 9
    0
    1
    2
    3

### Input
    [2,7,11,15]
    9

### Actual Answer
    [0,23333]

### Expected Answer
    [0,1]
Galus commented 3 years ago

https://github.com/ianding1/leetcode.vim/issues/59

For those who wanna help me get LeetCodeTest to do more....