Closed loisjee closed 5 years ago
Hi @SongJee,
Debug is not supported yet. If you want to debug your solution, you need to install related language extensions and write some code to wrap your solution.
I dont think this is a concern of this extension though.....
If you write your solution in cpp, you could take a look at the discussion in #241.
This feature is currently under early discussion, and is a concern of mine.
Just wanted to add that my approach has been using the CodeRunner extension: https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
I then add a call to the solution function, like so:
// Pre generated template
solution(...) {
...
}
// I add this line so running CodeRunner executes the function
solution()
Of course you can then add inputs to it:
a = 'foo'
b = 'bar'
solution(a, b)
Depending on the problem.
You can write test cases by yourself. Here is mine.
if __name__ == "__main__":
s = Solution()
testcases = [
("USA", True),
("leetcode", True),
("Facebook", True),
("HaWa", False),
]
for i, (inp, ans) in enumerate(testcases):
print("Test case: ", i)
print("answer: ", s.detectCapitalUse(inp))
print("expected: ", ans)
print()
As @littlebeandog said, the test is not a concern for this extension. This should be closed.
Thank you @All for providing the solutions.
I'm closing the issue for now, but the discussion is still open!
For anyone who has his own solution about debugging the code, please feel free to comment.
You can also add 👍 for your favorite solution, which could be a guide for those who need help.
Hello! I want to know how can i debug my code after i finish my solution in vscode. can anybody help me