LeetCode-OpenSource / vscode-leetcode

Solve LeetCode problems in VS Code
https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-leetcode
MIT License
8.22k stars 652 forks source link

Mention right or wrong answer #971

Open theashggl opened 3 months ago

theashggl commented 3 months ago

🚀 Feature Proposal

Just like the website where it is mentioned in colours if the answer is right or wrong we need it mentioned in the console or the submission page that opens in VSCode that the answer is right or wrong. In case of wrong at least it is not mentioned separately about it so if there's a long output then checking becomes difficult.

Vardhaman-Mehta commented 3 months ago

using js,

function checkAnswer(userAns, correctAns) { if (userAns === correctAns) { console.log('%ccorrect!', 'color: green;'); } else { console.log('%cIncorrect!', 'color: red;'); } console.log(Your answer: ${userAns}); console.log(Correct answer: ${correctAns}); }