All my Java solutions for Leetcode problems
To see a solution, follow these steps:
- Go to SOURCE ROOT.
- Go to the directory with the name of the problem (e.g. twoSum)
- Open the Solution file.
To run a file, follow these steps:
- Clone the repository using
git clone https://github.com/EmeraldTiub/LeetCode-Java - Make sure you have something to run the Java file (IntelliJ, whatever you have.)
- Uncomment the main() method in any one of the Solution files.
- Look for a section labeled "Create a testcase." in the main() method.
- Change the testcase to something that matches the description of the problem (description.txt)
- Run the Java file.
If you want to actually put it into a Leetcode editor, follow these steps:
- Open the file you want to put into the Leetcode editor.
- Put the entire script into the Leetcode editor for that problem.
- Delete out the first line (looks like this:
package [something];) - Delete the main() method.
- The code should be able to run inside the Leetcode editor.
Note: Copy ALL of the code, not just up until the end of the last function. Note: If there's some amount of folders that say "thisProblem" and "thisProblem2" and "thisProblem3" or something, that means I have different approaches for that problem. Note: JavaTesting is for testing Java features.
Java Problem Count: 1 (I add one every time I finish all approaches for a problem.)