Hello fellow coders! 👋 Welcome to my quirky and fun repository where I store all my solutions to LeetCode problems. Whether you're here to explore, learn, or just for a good laugh, you're in the right place! Let's dive into the magical world of coding challenges together. 🧙♂️✨
Before we start conquering challenges, let's set up our environment. I use Visual Studio Code (VSCode) with the LeetCode extension. It's like having a coding dojo right in your editor! 🥋💻 Here’s how you can set it up too:
-
Install Visual Studio Code: If you haven’t already, download VSCode.
-
Open VSCode Extensions: Click on the extensions icon in the sidebar or press
Ctrl+Shift+X
. -
Search for "LeetCode": Find the LeetCode extension by shengchen. It’s the one with a cool little ninja icon! 🥷
-
Install the Extension: Just click 'Install'. Easy-peasy, lemon-squeezy!
-
Login to LeetCode: Open the command palette (
Ctrl+Shift+P
), typeLeetCode Sign In
, and enter your credentials. If you're a ninja in disguise, make sure to use your stealthy login skills. 🐱👤
Now, let's get your personal LeetCode repository started! Here's a step-by-step guide to make it as smooth as butter on a hot pancake. 🥞
-
Create a New Repo: If you haven't yet, create a new repository on GitHub. Give it a name that sparks joy!
-
Clone the Repo in VSCode: In VSCode, press
Ctrl+Shift+P
, typeGit: Clone
, and paste your repo's URL. Choose a comfortable spot on your computer for it to live. -
Open Your Repo: After cloning, VSCode will ask if you want to open the repository. Go for it!
-
Add a Remote: If you've started locally, add a remote pointing to your GitHub repo. Open the terminal in VSCode (`Ctrl+```) and type:
git remote add origin YOUR_REPO_URL
-
Start Adding Solutions: Now, whenever you solve a problem on LeetCode, add the solution to this repository. You can create a directory for each problem or organize it however you like – unleash your inner organizer! 📁✨
-
Commit and Push: After adding your solutions, don't forget to commit and push your changes. Let the world see your awesome work!
git add . git commit -m "Add solution for problem XYZ" git push origin master
-
Rinse and Repeat: Keep solving, keep adding. Let this repo be a testament to your journey and growth!
- 📚 Learning: Review your progress and solutions over time.
- 🤝 Sharing: Help others learn from your solutions and approach.
- 👀 Visibility: Show your problem-solving skills to the world (or maybe future employers!).
If you find this repo helpful or if you have suggestions, feel free to open an issue or submit a pull request. I'm always open to collaboration and learning from the community.
Happy coding, and may the code be ever in your favor! 🌟
⭐ Star this repo if you find it quirky, fun, or helpful. Happy LeetCode-ing! 😄🎉
-
Install Node.js: Ensure Node.js is installed on your system. This provides the runtime for running JavaScript outside a browser and is essential for debugging TypeScript/JavaScript projects.
-
Configure
launch.json
:- In VSCode, navigate to the Debug view (
Ctrl+Shift+D
orCmd+Shift+D
on macOS). - Click on the "create a launch.json file" link and select the Node.js environment. This file tells VSCode how to launch and debug your application.
- In VSCode, navigate to the Debug view (
-
Install TypeScript and ts-node (for TypeScript projects):
- Run
npm install typescript ts-node --save-dev
in your project directory.ts-node
allows you to run TypeScript files directly in Node.js.
- Run
-
Debugging:
- Set breakpoints in your code by clicking the left margin next to the line numbers in the editor.
- Press
F5
to start debugging. Use the debug controls to step through your code, inspect variables, and evaluate expressions.
For client-side JavaScript debugging:
- Use Developer Tools in your preferred browser (e.g., Chrome DevTools, Firefox Developer Tools).
- Open the DevTools (
Ctrl+Shift+I
orCmd+Opt+I
on macOS), go to the Sources tab, and set breakpoints directly in your JavaScript code. - Refresh your page to hit the breakpoints and step through your code.
-
Install Python: Ensure Python is installed on your system and accessible from your terminal or command prompt.
-
Configure
launch.json
:- In VSCode, open your Python project.
- Go to the Debug view and click on "create a launch.json file", then select the Python environment.
- Adjust the
program
path to point to the script you want to debug.
-
Debugging:
- Set breakpoints by clicking next to the line numbers.
- Press
F5
to start debugging. Use the debug controls to step over, into, or out of your code blocks.
For a simpler setup or when working outside of VSCode, you can use pdb
, the Python debugger:
import pdb; pdb.set_trace()
- Insert the above line into your Python script at the point where you want to start debugging.
- Run your script. Execution will pause at
pdb.set_trace()
, and you can usepdb
commands (n
for next,c
for continue, etc.) to debug.