https://github.com/man0sh-r0y/leetcode-practice-enviroment
VS Code set up for your seamless problem solving journey. If You are a Windows / Mac user you can follow it.
https://github.com/man0sh-r0y/leetcode-practice-enviroment
leetcode problem-solving vscode
Last synced: 4 months ago
JSON representation
VS Code set up for your seamless problem solving journey. If You are a Windows / Mac user you can follow it.
- Host: GitHub
- URL: https://github.com/man0sh-r0y/leetcode-practice-enviroment
- Owner: Man0sh-r0y
- Created: 2023-12-27T03:51:20.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-18T12:29:28.000Z (about 1 year ago)
- Last Synced: 2025-03-20T06:32:50.310Z (8 months ago)
- Topics: leetcode, problem-solving, vscode
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Leetcode Problem Solving Enviromenet
If you are looking for a setup that looks like the one below, the following instructions might help you to configure this on your workstation.
1. Go to `view`
1. Then to `editor layout`
1. click on `split left`
This will separate the main Java file to the left from the input and output files. Now, to split input and output in two sections, have your cursor on input.txt file and then follow the same steps:
1. Go to `Editor Layout`
1. Then to `Split Down`
Since we have created and aligned the input and output files, we have to run these files. To make sure our input gives an output, we will have to configure it.
1. Go to `Terminal`
1. select `Configure Tasks`
1. choose `Create tasks.json file from the template`
1. then select `others`
After selecting others, you will see a new .vscode file and, in that, a tasks.json file, clear the current text in the json file and paste this.
## Fr Windows Users:
```bash
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile and run",
"type": "shell",
"command": "cmd",
"args": [
"/c",
"javac ${relativeFile} && java ${fileBasenameNoExtension} < input.txt > output.txt"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "java",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}
```
## For Mac Users:
```bash
{
"version": "2.0.0",
"tasks": [
{
"label": "compile and run",
"type": "shell",
"command": "javac ${file} && java ${fileBasenameNoExtension} < input.txt > output.txt",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
```
## How to run the code?
Press `Ctrl` + `Shift` + `B` (Windows/Linux) or `Cmd` + `Shift` + `B` (macOS) to trigger the build task. This will compile and run your Java code according to the specified task configuration.