Skip to content

konstantintogoi/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

leetcode

Solutions of LeetCode's problems.

Author: https://leetcode.com/TheKoStiG/

Run tests

Python solutions can be tested

python -m doctest 0001_two_sum.py

Table of content

problems/

# Difficulty Problem
3516 Easy Find Closest Person
3495 Hard Minimum Operations to Make Array Elements
3027 Hard Find the Number of Ways to Place People II
3025 Medium Find the Number of Ways to Place People I
2785 Medium Sort Vowels in a String
2749 Medium Minimum Operations to Make the Integer Zero
2421 Hard Number of Good Paths
2246 Hard Longest Path With Different Adjacent Characters
2244 Medium Minimum Rounds to Complete All Tasks
2359 Medium Find Closest Node to Given Two Nodes
2327 Medium Number of People Aware of a Secret
1912 Hard Design Movie Rental System
1833 Medium Maximum Ice Cream Bars
1792 Medium Maximum Average Pass Ratio
1721 Medium Swapping Nodes in a Linked List
1704 Easy Determine if String Halves Are Alike
1642 Medium Furthest Building You Can Reach
1626 Medium Best Team With No Conflicts
1551 Medium Minimum Operations to Make Array Equal
1519 Medium Number of Nodes in the Sub-Tree With the Same Label
1461 Medium Check If a String Contains All Binary Codes of Size K
1443 Medium Minimum Time to Collect All Apples in a Tree
1432 Medium Max Difference You Can Get From Changing an Integer
1431 Easy Kids With the Greatest Number of Candies
1396 Medium Design Underground System
1342 Easy Number of Steps to Reduce a Number to Zero
1332 Easy Remove Palindromic Subsequences
1317 Easy Convert Integer to the Sum of Two No-Zero Integers
1304 Easy Find N Unique Integers Sum up to Zero
1302 Medium Deepest Leaves Sum
1209 Medium Remove All Adjacent Duplicates in String II
1198 Medium Find Smallest Common Element in All Rows
1192 Hard Critical Connections in a Network
1165 Easy Single-Row Keyboard
1137 Easy N-th Tribonacci Number
1136 Medium Parallel Courses
1074 Hard Number of Submatrices That Sum to Target
1061 Medium Lexicographically Smallest Equivalent String
997 Easy Find the Town Judge
993 Easy Cousins in Binary Tree
974 Medium Subarray Sums Divisible by K
971 Medium Flip Binary Tree To Match Preorder Traversal
970 Medium Powerful Integers
966 Medium Vower Spellchecker
953 Easy Verifying an Alien Dictionary
944 Easy Delete Columns to Make Sorted
936 Hard Stamping The Sequence
926 Medium Flip String to Monotone Increasing
923 Medium 3Sum With Multiplicity
918 Medium Maximum Sum Circular Subarray
916 Medium Word Subsets
909 Medium Snakes and Ladders
870 Medium Advantage Shuffle
869 Medium Reordered Power of 2
841 Medium Keys and Rooms
823 Medium Binary Trees With Factors
820 Medium Short Encoding of Words
787 Medium Cheapest Flights Within K Stops
775 Medium Global and Local Inversions
744 Easy Find Smallest Letter Greater Than Target
714 Medium Best Time to Buy and Sell Stock with Transaction Fee
706 Easy Design HashMap
704 Easy Binary Search
696 Easy Count Binary Substrings
669 Medium Trim a Binary Search Tree
667 Medium Beautiful Arrangement II
658 Medium Find K Closest Elements
647 Medium Palindromic Substrings
645 Easy Set Mismatch
637 Easy Average of Levels in Binary Tree
623 Medium Add One Row to Tree
622 Medium Design Circular Queue
575 Easy Distribute Candies
554 Medium Brick Wall
536 Medium Construct Binary Tree from String
535 Medium Encode and Decode TinyURL
520 Easy Detect Capital
509 Easy Fibonacci Number
491 Medium Non-decreasing Subsequences
478 Medium Generate Random Point in a Circle
474 Medium Ones and Zeroes
472 Hard Concatenated Words
460 Hard LFU Cache
452 Medium Minimum Number of Arrows to Burst Balloons
423 Medium Reconstruct Original Digits from English
417 Medium Pacific Atlantic Water Flow
416 Medium Partition Equal Subset Sum
412 Easy Fizz Buzz
376 Medium Wiggle Subsequence
374 Easy Guess Number Higher or Lower
367 Easy Valid Perfect Square
354 Hard Russian Doll Envelopes
352 Hard Data Stream as Disjoint Intervals
350 Easy Intersection of Two Arrays II
349 Easy Intersection of Two Arrays
341 Medium Flatten Nested List Iterator
329 Hard Longest Increasing Path in a Matrix
326 Easy Power of Three
322 Medium Coin Change
290 Easy Word Pattern
287 Medium Find the Duplicate Number
278 Easy First Bad Version
268 Easy Missing Number
263 Easy Ugly Number
246 Easy Strobogrammatic Number
234 Easy Palindrome Linked List
191 Easy Number of 1 Bits
169 Easy Majority Element
167 Easy Two Sum II - Input array is sorted
165 Medium Compare Version Numbers
162 Medium Find Peak Element
160 Easy Intersection of Two Linked Lists
154 Hard Find Minimum in Rotated Sorted Array II
153 Medium Find Minimum in Rotated Sorted Array
149 Hard Max Points on a Line
144 Easy Binary Tree Preorder Traversal
134 Medium Gas Station
131 Medium Palindrome Partitioning
120 Medium Triangle
112 Easy Path Sum
111 Easy Minimum Depth of Binary Tree
110 Easy Balanced Binary Tree
108 Easy Convert Sorted Array to Binary Search Tree
107 Medium Binary Tree Level Order Traversal II
106 Medium Construct Binary Tree from Inorder and Postorder Traversal
105 Medium Construct Binary Tree from Preorder and Inorder Traversal
104 Easy Maximum Depth of Binary Tree
103 Medium Binary Tree Zigzag Level Order Traversal
102 Medium Binary Tree Level Order Traversal
101 Easy Symmetric Tree
100 Easy Same Tree
99 Medium Recover Binary Search Tree
98 Medium Validate Binary Search Tree
97 Medium Interleaving String
96 Medium Unique Binary Search Trees
95 Medium Unique Binary Search Trees II
94 Medium Binary Tree Inorder Traversal
93 Medium Restore IP Addresses
92 Medium Reverse Linked List II
91 Medium Decode Ways
90 Medium Subsets II
89 Medium Gray Code
88 Easy Merge Sorted Array
87 Hard Scramble String
86 Medium Partition List
85 Hard Maximal Rectangle
84 Hard Largest Rectangle in Histogram
83 Easy Remove Duplicates from Sorted List
82 Medium Remove Duplicates from Sorted List II
81 Medium Search in Rotated Sorted Array II
80 Medium Remove Duplicates from Sorted Array II
79 Medium Word Search
78 Medium Subsets
77 Medium Combinations
76 Hard Minimum Window Substring
75 Medium Sort Colors
74 Medium Search a 2D Matrix
73 Medium Set Matrix Zeroes
72 Medium Edit Distance
71 Medium Simplify Path
70 Easy Climbing Stairs
69 Easy Sqrt(x)
68 Hard Text Justification
67 Easy Add Binary
66 Easy Plus One
65 Hard Valid Number
64 Medium Minimum Path Sum
63 Medium Unique Paths II
62 Medium Unique Paths
61 Medium Rotate List
60 Hard Permutation Sequence
59 Medium Spiral Matrix II
58 Easy Length of Last Word
57 Medium Insert Interval
56 Medium Merge Intervals
55 Medium Jump Game
54 Medium Spiral Matrix
53 Easy Maximum Subarray
52 Hard N-Queens II
51 Hard N-Queens
50 Medium Pow(x, n)
49 Medium Group Anagrams
48 Medium Rotate Image
47 Medium Permutations II
46 Medium Permutations
45 Medium Jump Game II
44 Hard Wildcard Matching
43 Medium Multiply Strings
42 Hard Trapping Rain Water
41 Hard First Missing Positive
40 Medium Combination Sum II
39 Medium Combination Sum
38 Easy Count and Say
37 Hard Sudoku Solver
36 Medium Valid Sudoku
35 Easy Search Insert Position
34 Medium Find First and Last Position of Element in Sorted Array
33 Medium Search in Rotated Sorted Array
32 Hard Longest Valid Parentheses
31 Medium Next Permutation
30 Hard Substring with Concatenation of All Words
29 Medium Divide Two Integers
28 Easy Implement strStr()
27 Easy Remove Element
26 Easy Remove Duplicates from Sorted Array
25 Hard Reverse Nodes in k-Group
24 Medium Swap Nodes in Pairs
23 Hard Merge k Sorted Lists
22 Medimum Generate Parentheses
21 Easy Merge Two Sorted Lists
20 Easy Valid Parentheses
19 Medium Remove Nth Node From End of List
18 Medium 4Sum
17 Medium Letter Combinations of a Phone Number
16 Medium 3Sum Closest
15 Medium 3Sum
14 Easy Longest Common Prefix
13 Easy Roman To Integer
12 Medium Integer to Roman
11 Medium Container With Most Water
10 Hard Regular Expression Matching
9 Easy Palindrome Number
8 Medium String to Integer (atoi)
7 Easy Reverse Integer
6 Medium ZigZag Conversion
5 Medium Longest Palindromic Substring
4 Hard Median of Two Sorted Arrays
3 Medium Longest Substring Without Repeating Characters
2 Medium Add Two Numbers
1 Easy Two Sum

About

Solutions of LeetCode's problems.

Resources

Stars

Watchers

Forks

Languages