Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unstablebrainiac/leetcode
Solutions to LeetCode problems
https://github.com/unstablebrainiac/leetcode
hacktoberfest java leetcode
Last synced: 7 days ago
JSON representation
Solutions to LeetCode problems
- Host: GitHub
- URL: https://github.com/unstablebrainiac/leetcode
- Owner: unstablebrainiac
- Created: 2022-05-14T19:38:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-08T02:13:11.000Z (4 months ago)
- Last Synced: 2024-09-08T03:27:32.424Z (4 months ago)
- Topics: hacktoberfest, java, leetcode
- Language: Java
- Homepage:
- Size: 627 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LicenseKeyFormatting.java
Awesome Lists containing this project
README
# LeetCode
This repository contains my solutions of problems on [leetcode.com](leetcode.com).
### Project Structure
The classes in the root directory are the ones solved in the order that they are listed on the website.
The classes in dailychallenges and contest directories are self-explanatory.### File Structure
The class level javadoc has a link to the problem on the leetcode website.
The class name is derived by converting the problem name to PascalCase, removing any special characters and/or descriptions, and converting roman numerals to arabic.
For example, `Two Sum II - Input Array Is Sorted` becomes `TwoSum2` and `Pow(x, n)` becomes `PowXN`.For some problems, an external helper class is required such as `ListNode` or `NestedInteger`.
Such models are implemented as inner classes if they are specific to the problem at hand, or moved to a public class in the common package if reusable across problems.All classes also have a main method with a test case to run locally and test the functionality.
### Time vs Space vs Readability
In general, if the problem is trivial, preference is given to readability and concision.
A lot of easy problems are solved in one line, thanks to Java Streams.For medium and hard problems, and for TLEs on easy problems, time is preferred over space, unless Space Limit is exceeded, which is rare.