How to setup VS code for DSA and CP | Input / Output split format

preview_player
Показать описание

Detailed steps for Javascript:

In this video, we learn how to set up VSCode for practicing DSA and CP. You can use the editor of your choice, but most of us use VSCode.
Рекомендации по теме
Комментарии
Автор

for windows users : it will not work if your default terminal is Powershell make it cmd then it will work.
to change default terminal : terminal->change it to cmd.

karanshah
Автор

After Solving 200+ Sheet question & Several Contest - This VS code installation is all we needed

Akash-yrif
Автор

how is he so underrated? He has undoubtedly best coding content one can access for free in youtub

soumi
Автор

This is really the best DSA course completely indepth ...insanely incredible

shesparks
Автор

Great tip Striver bhaiya but those who don't want to do these much set-up they can just install one chrome extension "CPH for Competitive programmers" this extension will automatically access test case and run it for all test case in your VS code system.

wearedogs
Автор

Bhaiyya Thank you so much for your A2Z dsa sheet. I am a ECE 2023 graduate and i love coding I started my dsa journey 2 week ago but i am in stuck to do which kinds of problems do i need to do. There comes your your sheet. Even though i am doing dsa in python i have fundamentals in C++ so while you doing c++ i tried to do that code in python .So it is very beneficial for me to understand the language difference. Once again thank you so much. I have more way to go through your sheet . Please bless me 😊

ashmi
Автор

For windows users whose path contains spaces will face issues.
Just paste the below code, its the same code with a minute change in line "command"

Here is the corrected code

{
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "g++",
"args": [
"-std=c++17",
"-o",
"${fileBasenameNoExtension}",
"${file}"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "compile and run",
"type": "shell",
"command": "g++ -std=c++17 -o \"${file}\" && .\\${fileBasenameNoExtension} < input.txt > output.txt",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

ag
Автор

The terminal process -Command g++ -std=c++17 -o "demo" && .\demo < input.txt > output.txt" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.


Those who are getting this type of problem, you are doing a mistake as you are running in windows powershell terminal and not in command prompt terminal and in new version of vs code you cannot change your default terminal as shown by other youtubers, for changing try following this steps:

1: Go to setting icon of vs code in lower left corner.
2: Go to setting option (where shortcut is showing ctrl+, ).
3:search for default terminal.
4: here select the *default terminal profile for Windows* and change it to command prompt.

*NOTE* : You need to change from workspace (it is just below the search bar where you had type default terminal), if you change from user side it will not change, also it was the error from the beginning because you were changing default terminal from the user side and not the workspace side

abhinavpandey
Автор

Review: Too Good to be free. This Man is Educating India for free.

omkarmandal
Автор

Bhaiya I'm in my 2nd year of college and its a tier 3 one, so most of us students depend on your DSA videos ..
bhaiya we are really really respectful and grateful to you for your service ... And hope you will continue to do your best in everything 👍👍👍
bhaiya I wanted to ask that when will you be uploading the articles attached with the questions provided and Videos which are pending right now ?? Like is there a 1 week uploading thing or something ??
please reply to this comment coz many of us are waiting for the answer.
If any viewers or Bhaiya yourself find this rude then I'm very very sorry ... coz I know that working + making videos is hectic work but just asking coz many of us dont know

VatsalJain-jpux
Автор

*OUTPUT NOT PRINTING ISSUE FIX IN WINDOWS*

Step 1:

Replace the following line "${workspaceFolder}\\jspwTest.cpp", with "\"${workspaceFolder}\\jspwTest.cpp\"",

Step 2:

1: Go to setting icon of vs code in lower left corner.
2: Go to setting option (where shortcut is showing ctrl+, ).
3:search for default terminal.
4: here select the default terminal profile for Windows and change it to command prompt.

slighty
Автор

[IF ANYONE WANTS TO KNOW WHAT'S HAPPENING]
This video is awesome! Just wanted to break down what's happening behind the scenes:
The trick is to use tasks.json to redirect the default input stream to cin.
Notice the command line options uses '<' for input.txt and '>' for output.txt. Those are actually compiler flags for g++!
Super cool trick. 👍
For reference, see the value of tasks[1]["command"] in tasks.json at line 22 visible at the 5:21 mark in the video.
I am just adding context to the magic!
Thanks again for sharing.

SaptadeepDutta_Ex-Xerox
Автор

Thank you Striver for making this course Language Independent, I am following the course in JavaScript only problem I have is that sometimes the codeStudio links you provide the platform doesn't have a Javascript Compiler but LeetCode has but anyways I code on Vscode now.

.squash.
Автор

I was setting up VSCode just yesterday and faced difficulty omg and this vid comes out today ❤

Sawlf
Автор

I belong to Python Community.
Thankyou Stiver, know the life is sorted. I use to type multiple inputs by running code again and again.

studynewthings
Автор

Thanks a lot Striver for the LL videos in the A2Z DSA Series... really enjoying the videos. You're the GOAT

senseiAree
Автор

I am so much grateful to you for this video. I want it for the last few days.
Many many many thanks.🥰🥰🥰🙏

BiswajitDas-fjgp
Автор

Thanks Striver for sharing this ! It was of great help .

KoushikDasMagnate
Автор

after almost wasting 50 hours on dsa in youtube I got you sir your explanation was just wowwww

thefourhourtalk
Автор

c++ setup not working for windows, getting "The syntax of the command is incorrect."

AnonymousHacker-gwpn