Skip to content

Code executes but doesn't test #97

Closed
@bcatalfo

Description

@bcatalfo

Here is my console

bcatalfo@pasokon:~/Documents/LeetCode$ leetcode test 1
[INFO  leetcode_cli::plugins::leetcode] Sending code to judge...
error: invalid type: sequence, expected a string at line 1 column 184
bcatalfo@pasokon:~/Documents/LeetCode$ leetcode -d test 1
[2022-09-28T01:50:51Z TRACE leetcode_cli::cache] Exec problem filter —— Test or Submit
[2022-09-28T01:50:51Z TRACE leetcode_cli::cache] pre run code...
[2022-09-28T01:50:51Z TRACE leetcode_cli::cache] Pre run code result {"data_input": "[2,7,11,15]\n9\n[3,2,4]\n6\n[3,3]\n6", "lang": "python3", "question_id": "1", "typed_code": "class Solution:\n    def twoSum(self, nums: list[int], target: int) -> list[int]:\n        mem = {}\n        for i, n in enumerate(nums):\n            if target - n in mem:\n                return [i, mem[target-n]]\n            mem[n] = i\n        raise Exception(\"woops\")\n\n", "name": "Two Sum"}, "https://leetcode.com/problems/two-sum/interpret_solution/", "https://leetcode.com/api/problems/$category/"
[2022-09-28T01:50:51Z INFO  leetcode_cli::plugins::leetcode] Sending code to judge...
[2022-09-28T01:50:51Z TRACE leetcode_cli::plugins::leetcode::req] Running leetcode::run_code...
[2022-09-28T01:50:51Z TRACE leetcode_cli::cache] Run code result RunCode {
        interpret_id: "runcode_1664329851.69111_evj0kaqgk6",
        test_case: "[2,7,11,15]\n9\n[3,2,4]\n6\n[3,3]\n6",
        submission_id: 0,
    }
[2022-09-28T01:50:51Z TRACE leetcode_cli::cache] Run veriy recursion...
[2022-09-28T01:50:51Z TRACE leetcode_cli::plugins::leetcode] Verifying result...
[2022-09-28T01:50:51Z TRACE leetcode_cli::plugins::leetcode::req] Running leetcode::verify_result...
[2022-09-28T01:50:51Z DEBUG leetcode_cli::cache] debug resp raw text: 
    "{\"state\": \"STARTED\"}"
[2022-09-28T01:50:51Z DEBUG leetcode_cli::cache] debug json deserializing: 
    Ok(
        VerifyResult {
            state: "STARTED",
            name: "",
            data_input: "",
            result_type: Submit,
            pretty_lang: "",
            correct_answer: false,
            code_answer: [],
            code_output: [],
            expected_output: [],
            std_output: "",
            status: VerifyStatus {
                status_code: 0,
                status_msg: "",
                status_memory: "",
                status_runtime: "",
                runtime_error: "",
            },
            analyse: Analyse {
                total_correct: None,
                total_testcases: None,
                runtime_percentile: None,
                memory_percentile: None,
            },
            expected: Expected {
                expected_code_answer: [],
            },
            error: CompileError {
                full_compile_error: "",
            },
            submit: Submit {
                question_id: "",
                last_testcase: "",
                compare_result: "",
            },
        },
    )
[2022-09-28T01:50:51Z TRACE leetcode_cli::cache] Run veriy recursion...
[2022-09-28T01:50:51Z TRACE leetcode_cli::plugins::leetcode] Verifying result...
[2022-09-28T01:50:51Z TRACE leetcode_cli::plugins::leetcode::req] Running leetcode::verify_result...
[2022-09-28T01:50:52Z DEBUG leetcode_cli::cache] debug resp raw text: 
    "{\"status_code\": 10, \"lang\": \"python3\", \"run_success\": true, \"status_runtime\": \"57 ms\", \"memory\": 13724000, \"code_answer\": [\"[1,0]\", \"[2,1]\", \"[1,0]\"], \"code_output\": [], \"std_output\": [\"\", \"\", \"\", \"\"], \"elapsed_time\": 78, \"task_finish_time\": 1664329851943, \"expected_status_code\": 10, \"expected_lang\": \"cpp\", \"expected_run_success\": true, \"expected_status_runtime\": \"0\", \"expected_memory\": 6352000, \"expected_code_answer\": [\"[0,1]\", \"[1,2]\", \"[0,1]\"], \"expected_code_output\": [], \"expected_std_output\": [\"\", \"\", \"\", \"\"], \"expected_elapsed_time\": 11, \"expected_task_finish_time\": 1664329545474, \"correct_answer\": true, \"compare_result\": \"111\", \"total_correct\": 3, \"total_testcases\": 3, \"runtime_percentile\": null, \"status_memory\": \"13.7 MB\", \"memory_percentile\": null, \"pretty_lang\": \"Python3\", \"submission_id\": \"runcode_1664329851.69111_evj0kaqgk6\", \"status_msg\": \"Accepted\", \"state\": \"SUCCESS\"}"
[2022-09-28T01:50:52Z DEBUG leetcode_cli::cache] debug json deserializing: 
    Err(
        Error("invalid type: sequence, expected a string", line: 1, column: 184),
    )
error: invalid type: sequence, expected a string at line 1 column 184
bcatalfo@pasokon:~/Documents/LeetCode$ leetcode test 1
[INFO  leetcode_cli::plugins::leetcode] Sending code to judge...
error: invalid type: sequence, expected a string at line 1 column 184
bcatalfo@pasokon:~/Documents/LeetCode$ leetcode exec 1
[INFO  leetcode_cli::plugins::leetcode] Sending code to judge...

Success

Runtime: 130 ms, faster than 48% of Python3 online submissions for Two Sum.

Memory Usage: 15.2 MB, less than 24% of Python3 Two Sum.


bcatalfo@pasokon:~/Documents/LeetCode$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions