This repository contains solutions to LeetCode's 75 Essential & Trending Problems, all implemented in Java.
Must-do problem list for interview prep: The problems selected in this repository are curated based on their frequency of appearance in technical interviews and their relevance in assessing a candidate's problem-solving skills. Mastering these problems can significantly boost your chances of success in coding interviews.
Best for 1~3 month of prep time: Whether you're gearing up for a new job hunt or just looking to brush up on your algorithm skills, this collection of problems is optimally designed to be tackled over a period of one to three months. This duration allows for both in-depth understanding and regular practice, ensuring that you're well-prepared and confident in your problem-solving abilities.
Feel free to explore, practice, and ace your upcoming interviews!
- Clone the repository:
git clone https://github.com/teamlead/leetcode-75-solutions-java.git
- Navigate to a specific problem:
cd src/category_name
- Compile and run the Java solution:
javac ProblemName.java
java -ea ProblemName
or if you use Java11+ run the source code file directly, without intermediate compilation:
java -ea ProblemName.java
If using IDEA, right-click the src folder, then select "Mark Directory" as "Sources Root". Now, Java files should benefit from all the Java IDE features of IntelliJ IDEA, including autocomplete, debug, syntax highlighting, and more.
Remember, when using assertions in Java, ensure that you've enabled them by using the -ea
flag when running the Java program.
Feel free to fork this repository and add your solutions or improvements. Pull requests are welcome!
The problems discussed in this repository are sourced from LeetCode and are Copyrighted Material owned by LeetCode. They are used here for educational purposes only. It is strongly advised not to use them in any other way that might infringe on the intellectual property rights of the original source. Always refer to the original LeetCode link for the complete and most up-to-date problem statement.
This project is open source and available under the MIT License.