GithubHelp home page GithubHelp logo

Comments (8)

jdneo avatar jdneo commented on August 10, 2024

Hi @Licheng-Xu

可以提供一下题号吗?

from vscode-leetcode.

Licheng-Xu avatar Licheng-Xu commented on August 10, 2024

不好意思,这几天忙着其他事情了。

题号:[13]
Roman to Integer

选择直接输入测试样例,输入 "LVIII",之后返回了

Input data:
LVIII

Actual
× Runtime Error
× runtime: N/A
× answer:
× stdout: ''
× error: terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid

Expected
× Runtime Error
× runtime: N/A
× answer:
× stdout: ''
× error: Line 68: ValueError: No JSON object could be decoded

from vscode-leetcode.

jdneo avatar jdneo commented on August 10, 2024

@Licheng-Xu It looks like a bug. Thank you for the feedback. 👍

from vscode-leetcode.

LiuLiC avatar LiuLiC commented on August 10, 2024

Hi @jdneo , looks like the bug happened because in test.ts: when we get the test string, we replace all /" with "", which drops quotes. Thus in leetcode, it can't recognize the input as a string.

from vscode-leetcode.

jdneo avatar jdneo commented on August 10, 2024

@LiuLiC Yeah, I know that. Because I remember that there is a problem if we do not do the replacement.

Not quite sure how the current status is. PR is welcome if you are willing to fix this. 😄

from vscode-leetcode.

jdneo avatar jdneo commented on August 10, 2024

Fixed in #111.

Will get released in 0.10.2

from vscode-leetcode.

jdneo avatar jdneo commented on August 10, 2024

Hmm...

Actually, this bug is not well fixed in #111. I did some experiments on different platforms and found that the test string needs to be parsed in different ways:

Bash (Mac)

'"XX"'

CMD (Windows)

"\"XX\""

PowerShell (Windows)

'\"XX\"'

I have no Linux machine to verify, but guess the behavior should be similar with that in Bash.

So I created another PR: #113, to fix it.

from vscode-leetcode.

jdneo avatar jdneo commented on August 10, 2024

@ALL 0.10.2 has been released with this fix.

from vscode-leetcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.