Closed crokobit closed 4 years ago
Hi,
I ran the procedure on my computer but didn't reproduce this error. I tried both in C++ and Python and found that they returned a list of strings.
Could you provide more information, such as the code that you used?
The Python code that I used for two sum:
class Solution(object):
def twoSum(self, nums, target):
print('1,2,3')
And I got:
# Two Sum
## State
- Finished
## Runtime
- 32 ms
## Standard Output
1,2,3
### Input
[2,7,11,15]
9
### Actual Answer
[]
### Expected Answer
[0,1]
Hi, @ianding1 On my side, I used javascript to submit to code.
var twoSum = function(nums, target) {
return [0, 1];
};
The result output
{'passed': 4, 'runtime_percentile': v:null, 'answer': [], 'title': 'Two Sum', 'state': 'Wrong Answer', 'testcase': ['[3,2,4]', '6'], 'runtime': 'N/A', 'stdout': '[0,1]', 'total': 29, 'expected_answer': []
, 'error': []}
The stdout is a string, so if I call this:
call extend(output, s:FormatSection('Standard Output', result['stdout'], 2))
It will show the error by @crokobit mentioned.
It seems because my return value is an array.
Please try updating to the latest version.
Related commit: b5c55f41299e511b0e4076b03215a0
Fixed. Thank you
Nice work @motephyr @ianding1 :) That's the opensource spirit. 🍻
NVIM v0.3.8
reproduce procedure:
or
But it shows no error with the right code.
The error is: