My pet project. This is a code examples with my solutions for Leetcode problems.
- Java SE Development Kit 17
- Git 1.7.x (or newer)
- 3 - Longest Substring Without Repeating Characters (find the longest substring without repeating characters)
- 20 - Valid Parentheses (whether the string with parentheses is valid or not)
- 26 - Remove Duplicates from Sorted Array (remove duplicates from sorted array)
- 56 - Merge Intervals (merging array intervals)
- 66 - Plus One (increment the large integer by one)
- 74 - Search a 2D Matrix (the number is in the matrix, true or false)
- 125 - Valid Palindrome (text is a palindrome, true or false)
- 161 - One Edit Distance (two strings differ from each other by one character, true or false)
- 191 - Number of 1 Bits (the number of 1 bits in unsigned integer)
- 200 - Number of Islands (counting the number of islands in the grid NxN)
- 206 - Reverse Linked List (reverse the linked list)
- 231 - Power of two (number is a power of two or not)
- 242 - Validate Anagram (text is a anagram, true or false)
- 290 - Word Pattern (pattern and text follows the same behavior - full match)
- 443 - String Compression (compress array of characters)
- 468 - Validate IP Address (string is a valid IPv4/IPv6 address or neither)
- 509 - Fibonacci Number (each number is the sum of the two preceding ones)
- 876 - Middle of the Linked List (find middle of the linked list)
- build app
~$ ./gradlew clean build
BUILD SUCCESSFUL in 2s
4 actionable tasks: 4 executed
- start app with problem (example)
~$ java -jar ./build/libs/leetcode-examples.jar validParentheses
Start validating parentheses...
Parentheses: ()[{}]
Result. Parentheses is: valid
- parameters:
- numberOfIslands
- validParentheses
- powerOfTwo
- search2DMatrix
- numberOfOneBits
- reverseLinkedList
- middleOfLinkedList
- validPalindrome
- validAnagram
- wordPattern
- validIpAddress
- plusOne
- removeDuplicatesFromSortedArray
- oneEditDistance
- fibonacciNumber
- stringCompression
- longestSubstringWithoutRepeatingChars
- mergeIntervals