Skip to content

rezamobaraki/leetcode-top-interview-150

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project contains solutions to the top 150 LeetCode interview questions, implemented in Python, Go, JavaScript, and TypeScript.

Project Structure

  • golang/: Contains Go implementations of the solutions.
  • python/: Contains Python implementations of the solutions.
  • javascript/: Contains JavaScript implementations of the solutions.
  • typescript/: Contains TypeScript implementations of the solutions.

Table of Contents

  1. Installation
  2. Usage
  3. Contributing
  4. License
  5. Contact
  6. References
  7. Project Status
  8. Release History
  9. Author
  10. Contributors

Installation

Go

  1. Ensure you have Go installed. You can download it from here.
  2. Clone the repository:
    git clone https://github.com/rezamobaraki/leetcode-top-interview-150.git
    cd leetcode-top-interview-150/golang
  3. Run the Go files:
    go run <filename>.go

Python

  1. Ensure you have Python installed. You can download it from here.
  2. Clone the repository:
    git clone https://github.com/rezamobaraki/leetcode-top-interview-150.git
    cd leetcode-top-interview-150/python
  3. Run the Python files:
    python <filename>.py

JavaScript

  1. Ensure you have Node.js installed. You can download it from here.
  2. Clone the repository:
    git clone https://github.com/rezamobaraki/leetcode-top-interview-150.git
    cd leetcode-top-interview-150/javascript
  3. Run the JavaScript files:
    node <filename>.js

TypeScript

  1. Ensure you have Node.js and TypeScript installed. You can download Node.js from here and install TypeScript globally using:
    npm install -g typescript
  2. Clone the repository:
    git clone https://github.com/rezamobaraki/leetcode-top-interview-150.git
    cd leetcode-top-interview-150/typescript
  3. Compile and run the TypeScript files:
    tsc <filename>.ts
    node <filename>.js

Usage

Each file in the golang/, python/, javascript/, and typescript/ directories corresponds to a specific LeetCode problem. You can run the files to see the solutions in action.

Example

To run the is-subsequence solution in Go:

cd golang/two-pointer
go run is-subsequence.go

To run the is-subsequence solution in Python:

cd python/two-pointer
python is-subsequence.py

To run the is-subsequence solution in JavaScript:

cd javascript/two-pointer
node is-subsequence.js

To run the is-subsequence solution in TypeScript:

cd typescript/two-pointer
tsc is-subsequence.ts
node is-subsequence.js

Running the Solutions

To run any solution, navigate to the appropriate directory and execute the file using the respective language's command.

Testing the Solutions

You can add test cases to the main function or use testing frameworks like unittest for Python, testing for Go, jest for JavaScript, and jest for TypeScript.

Adding New Solutions

  1. Create a new file in the appropriate directory (golang/, python/, javascript/, or typescript/).
  2. Implement the solution for the LeetCode problem.
  3. Add test cases to the main function or a separate test file.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Contact

For any questions or suggestions, please open an issue in the repository.

References

Project Status

This project is actively maintained and updated with new solutions.

Release History

  • 1.0.0
    • Initial release with solutions to the top 150 LeetCode questions.

Author

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •