Skip to content

This repository contains my solutions and explanations to the problems on LeetCode. All are written in Java and MySQL. The problems contain link to the task, solution, tests and readme with description of solution and time complexity.

License

Notifications You must be signed in to change notification settings

SerhiiRyzhkov/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAVA & SQL Solutions for Leetcode

This repository contains solutions, tests and descriptions to LeetCode problems, implemented in Java and MySQL

What is LeetCode?

LeetCode is an online platform where you can practice coding and prepare for technical interviews. It features a vast collection of algorithm and data structure problems, ranging from easy to hard, that you can solve using your preferred programming language.

How to Use This Repository?

The solutions to LeetCode problems are organized by problem number, level and type: java or sql. Each directory contains a README file with a brief description of the problem and a solution file with the corresponding code. In directory test you can find tests for problem`s solutions.

Java Solutions

# Title Solution Test
404 Sum of Left Leaves Java Test
459 Repeated Substring Pattern Java Test
922 Sort Array By Parity II Java Test
1089 Duplicate Zeros Java Test
1431 Kids With the Greatest Number of Candies Java Test
1436 Destination City Java Test
1636 Sort Array by Increasing Frequency Java Test
1725 Number Of Rectangles That Can Form The Largest Square Java Test
1945 Sum of Digits of String After Convert Java Test
2042 Check if Numbers Are Ascending in a Sentence Java Test
2351 First Letter to Appear Twice Java Test
58 Length of Last Word Java Test
203 Remove Linked List Elements Java Test
415 Add Strings Java Test
748 Shortest Completing Word Java Test
1385 Find the Distance Value Between Two Arrays Java Test
1796 Second Largest Digit in a String Java Test
1909 Remove One Element to Make the Array Strictly Increasing Java Test
2309 Greatest English Letter in Upper and Lower Case Java Test
2432 The Employee That Worked on the Longest Task Java Test
326 Power of Three Java Test
766 Toeplitz Matrix Java Test
2405 Optimal Partition of String Java Test
2605 Form Smallest Number From Two Digit Arrays Java Test
179 Largest Number Java Test
1768 Merge Strings Alternately Java Test
470 Shuffle the Array Java Test
2099 Find Subsequence of Length K With the Largest Sum Java Test
2341 Maximum Number of Pairs in Array Java Test
2287 Rearrange Characters to Make Target String Java Test
1502 Can Make Arithmetic Progression From Sequence Java Test
1502 Is Subsequence Java Test
2150 Find All Lonely Numbers in the Array Java Test
2409 Count Days Spent Together Java Test
2315 Count Asterisks Java Test
2037 Minimum Number of Moves to Seat Everyone Java Test
1078 Occurrences After Bigram Java Test
1668 Maximum Repeating Substring Java Test
2652 Sum Multiples Java Test
884 Uncommon Words from Two Sentences Java Test
1399 Count Largest Group Java Test
2515 Shortest Distance to Target String in a Circular Array Java Test
2057 Smallest Index With Equal Value Java Test
1886 Determine Whether Matrix Can Be Obtained By Rotation Java Test
1185 Day of the Week Java Test
993 Cousins in Binary Tree Java Test
1566 Detect Pattern of Length M Repeated K or More Times Java Test
13 Roman to Integer Java Test
2278 Percentage of Letter in String Java Test
338 Counting Bits Java Test
1221 Split a String in Balanced Strings Java Test
1287 Element Appearing More Than 25% In Sorted Array Java Test
144 Binary Tree Preorder Traversal Java Test
2566 Maximum Difference by Remapping a Digit Java Test
1984 Minimum Difference Between Highest and Lowest of K Scores Java Test
2224 Minimum Number of Operations to Convert Time Java Test
1854 Maximum Population Year Java Test
231 Power of Two Java Test
401 Binary Watch Java Test
623 Add One Row to Tree Java Test
2027 Minimum Moves to Convert String Java Test
2079 Watering Plants Java Test
763 Partition Labels Java Test
169 Majority Element Java Test
234 Palindrome Linked List Java Test
2606 Find the Substring With Maximum Cost Java Test
2154 Keep Multiplying Found Values by Two Java Test
2389 Longest Subsequence With Limited Sum Java Test
1232 Check If It Is a Straight Line Java Test
2418 Sort the People Java Test
219 Contains Duplicate II Java Test
2748 Number of Beautiful Pairs Java Test
2192 All Ancestors of a Node in a Directed Acyclic Graph Java Test
1882 Process Tasks Using Servers Java Test
897 Increasing Order Search Tree Java Test
1895 Sorting the Sentence Java Test
387 First Unique Character in a String Java Test
412 Fizz Buzz Java Test
977 Squares of a Sorted Array Java Test
2144 Minimum Cost of Buying Candies With Discount Java Test
2744 Find Maximum Number of String Pairs Java Test
35 Search Insert Position Java Test
1403 Minimum Subsequence in Non-Increasing Order Java Test
111 Minimum Depth of Binary Tree Java Test
1971 Find if Path Exists in Graph Java Test
863 All Nodes Distance K in Binary Tree Java Test
1189 Maximum Number of Balloons Java Test
594 Longest Harmonious Subsequence Java Test
2194 Cells in a Range on an Excel Sheet Java Test
802 Find Eventual Safe States Java Test
965 Univalued Binary Tree Java Test
1491 Average Salary Excluding the Minimum and Maximum Salary Java Test
2670 Find the Distinct Difference Array Java Test
872 Leaf-Similar Trees Java Test
697 Degree of an Array Java Test
1893 Check if All the Integers in a Range Are Covered Java Test
2160 Minimum Sum of Four Digit Number After Splitting Digits Java Test
136 Single Number Java Test
207 Course Schedule Java Test
836 Rectangle Overlap Java Test
1218 Longest Arithmetic Subsequence of Given Difference Java Test
1560 Most Visited Sector in a Circular Track Java Test
507 Perfect Number Java Test
735 Asteroid Collision Java Test
953 Verifying an Alien Dictionary Java Test
1672 Richest Customer Wealth Java Test
867 Transpose Matrix Java Test
2769 Find the Maximum Achievable Number Java Test
674 Longest Continuous Increasing Subsequence Java Test
1422 Maximum Score After Splitting a String Java Test
2798 Number of Employees Who Met the Target Java Test
598 Range Addition II Java Test
495 Teemo Attacking Java Test
605 Can Place Flowers Java Test
2660 Determine the Winner of a Bowling Game Java Test
783 Minimum Distance Between BST Nodes Java Test
1812 Determine Color of a Chessboard Square Java Test
1619 Mean of Array After Removing Some Elements Java Test
671 Second Minimum Node In a Binary Tree Java Test
2586 Count the Number of Vowel Strings in Range Java Test
1346 Check If N and Its Double Exist Java Test
1805 Number of Different Integers in a String Java Test
2220 Minimum Bit Flips to Convert Number Java Test
9 Palindrome Number Java Test
530 Minimum Absolute Difference in BST Java Test
1662 Check If Two String Arrays are Equivalent Java Test
2928 Distribute Candies Among Children I Java Test
1816 Truncate Sentence Java Test
463 Island Perimeter Java Test
461 Hamming Distance Java Test
1859 Sorting the Sentence Java Test
2399 Check Distances Between Same Letters Java Test
1309 Decrypt String from Alphabet to Integer Mapping Java Test
777 Swap Adjacent in LR String Java Test
2937 Make Three Strings Equal Java Test
2259 Remove Digit From Number to Maximize Result Java Test
70 Climbing Stairs Java Test
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Java Test
2558 Take Gifts From the Richest Pile Java Test
1281 Subtract the Product and Sum of Digits of an Integer Java Test
21 Merge Two Sorted Lists Java Test
1304 Find N Unique Integers Sum up to Zero Java Test
925 Long Pressed Name Java Test
1822 Sign of the Product of an Array Java Test
2022 Convert 1D Array Into 2D Array Java Test
118 Pascal's Triangle Java Test
69 Sqrt(x) Java Test
2032 Two Out of Three Java Test
509 Fibonacci Number Java Test
2185 Counting Words With a Given Prefix Java Test
2441 Largest Positive Integer That Exists With Its Negative Java Test
2600 K Items With the Maximum Sum Java Test
1002 Find Common Characters Java Test
1773 Count Items Matching a Rule Java Test
2006 Count Number of Pairs With Absolute Difference K Java Test
1791 Find Center of Star Graph Java Test
1629 Slowest Key Java Test
226 Invert Binary Tree Java Test
389 Find the Difference Java Test
1637 Widest Vertical Area Between Two Points Containing No Points Java Test
1342 Number of Steps to Reduce a Number to Zero Java Test
171 Excel Sheet Column Number Java Test
3079 Find the Sum of Encrypted Integers Java Test
1356 Sort Integers by The Number of 1 Bits Java Test
1652 Defuse the Bomb Java Test
2788 Split Strings by Separator Java Test
504 Base 7 Java Test
2824 Count Pairs Whose Sum is Less than Target Java Test
2347 Best Poker Hand Java Test
1748 Sum of Unique Elements Java Test
1624 Largest Substring Between Two Equal Characters Java Test
1995 Count Special Quadruplets Java Test
383 Ransom Note Java Test
2525 Categorize Box According to Criteria Java Test
3099 Harshad Number Java Test

SQL Solutions

# Title Solution
1211 Queries Quality and Percentage SQL
1280 Students and Examinations SQL
1327 List the Products Ordered in a Period SQL
1873 Customers Who Never Order SQL
627 Swap Salary SQL
1978 Employees Whose Manager Left the Company SQL
596 Classes More Than 5 Students SQL
610 Triangle Judgement SQL
196 Delete Duplicate Emails SQL
1517 Find Users With Valid E-Mails SQL
182 Duplicate Emails SQL
620 Not Boring Movies SQL
586 Customer Placing the Largest Number of Orders SQL

About

This repository contains my solutions and explanations to the problems on LeetCode. All are written in Java and MySQL. The problems contain link to the task, solution, tests and readme with description of solution and time complexity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages