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/notkonstantin/

Run tests

Python solutions can be tested

python -m doctest 0001_two_sum.py

Table of content

problems/

# Diff. 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 Med. Find the Number of Ways to Place People I
2785 Med. Sort Vowels in a String
2749 Med. Minimum Operations to Make the Integer Zero
2421 Hard Number of Good Paths
2300 Med. Successful Pairs of Spells and Potions
2246 Hard Longest Path With Different Adjacent Characters
2244 Med. Minimum Rounds to Complete All Tasks
2359 Med. Find Closest Node to Given Two Nodes
2353 Med. Design a Food Rating System
2327 Med. Number of People Aware of a Secret
2221 Med. Find Triangular Sum of an Array
2197 Hard Replace Non-Coprime Numbers in Array
2141 Hard Maximum Running Time of N Computers
1935 Easy Maximum Number of Words You Can Type
1912 Hard Design Movie Rental System
1833 Med. Maximum Ice Cream Bars
1792 Med. Maximum Average Pass Ratio
1733 Med. Minimum Number of People to Teach
1721 Med. Swapping Nodes in a Linked List
1704 Easy Determine if String Halves Are Alike
1642 Med. Furthest Building You Can Reach
1626 Med. Best Team With No Conflicts
1551 Med. Minimum Operations to Make Array Equal
1519 Med. Number of Nodes in the Sub-Tree With the Same Label
1518 Easy Water Bottles
1493 Med. Longest Subarray of 1's After Deleting One Element
1488 Med. Avoid Flood in The City
1480 Easy Running Sum of 1d Array
1461 Med. Check If a String Contains All Binary Codes of Size K
1443 Med. Minimum Time to Collect All Apples in a Tree
1432 Med. Max Difference You Can Get From Changing an Integer
1431 Easy Kids With the Greatest Number of Candies
1396 Med. Design Underground System
1346 Easy Check If N and Its Double Exist
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 Med. Deepest Leaves Sum
1299 Easy Replace Elements with Greatest Element on Right Side
1295 Easy Find Numbers with Even Number of Digits
1209 Med. Remove All Adjacent Duplicates in String II
1198 Med. 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 Med. Parallel Courses
1133 Easy Largest Unique Number
1089 Easy Duplicate Zeros
1074 Hard Number of Submatrices That Sum to Target
1061 Med. Lexicographically Smallest Equivalent String
1051 Easy Height Checker
1039 Med. Minimum Score Triangulation of Polygon
1015 Med. Smallest Integer Divisible by K
1004 Med. Max Consecutive Ones III
997 Easy Find the Town Judge
993 Easy Cousins in Binary Tree
977 Easy Squares of a Sorted Array
976 Easy Largest Perimeter Triangle
974 Med. Subarray Sums Divisible by K
971 Med. Flip Binary Tree To Match Preorder Traversal
970 Med. Powerful Integers
966 Med. Vower Spellchecker
953 Easy Verifying an Alien Dictionary
944 Easy Delete Columns to Make Sorted
941 Easy Valid Mountain Array
936 Hard Stamping The Sequence
933 Easy Number of Recent Calls
926 Med. Flip String to Monotone Increasing
923 Med. 3Sum With Multiplicity
918 Med. Maximum Sum Circular Subarray
916 Med. Word Subsets
909 Med. Snakes and Ladders
905 Easy Sort Array By Parity
876 Easy Middle of the Linked List
870 Med. Advantage Shuffle
869 Med. Reordered Power of 2
841 Med. Keys and Rooms
823 Med. Binary Trees With Factors
820 Med. Short Encoding of Words
812 Easy Largest Triangle Area
787 Med. Cheapest Flights Within K Stops
778 Hard Swim in Rising Water
775 Med. Global and Local Inversions
744 Easy Find Smallest Letter Greater Than Target
728 Easy Self Dividing Numbers
714 Med. Best Time to Buy and Sell Stock with Transaction Fee
706 Easy Design HashMap
704 Easy Binary Search
696 Easy Count Binary Substrings
669 Med. Trim a Binary Search Tree
667 Med. Beautiful Arrangement II
658 Med. Find K Closest Elements
647 Med. Palindromic Substrings
645 Easy Set Mismatch
637 Easy Average of Levels in Binary Tree
623 Med. Add One Row to Tree
622 Med. Design Circular Queue
611 Med. Valid Triangle Number
589 Easy N-ary Tree Preorder Traversal
575 Easy Distribute Candies
554 Med. Brick Wall
536 Med. Construct Binary Tree from String
535 Med. Encode and Decode TinyURL
520 Easy Detect Capital
509 Easy Fibonacci Number
491 Med. Non-decreasing Subsequences
485 Easy Max Consecutive Ones
478 Med. Generate Random Point in a Circle
474 Med. Ones and Zeroes
472 Hard Concatenated Words
460 Hard LFU Cache
452 Med. Minimum Number of Arrows to Burst Balloons
448 Easy Find All Numbers Disappeared in an Array
424 Med. Longest Repeating Character Replacement
423 Med. Reconstruct Original Digits from English
417 Med. Pacific Atlantic Water Flow
416 Med. Partition Equal Subset Sum
414 Easy Third Maximum Number
412 Easy Fizz Buzz
407 Hard Trapping Rain Water II
392 Easy Is Subsequence
383 Easy Ransom Note
377 Med. Combination Sum IV
376 Med. 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 Med. Flatten Nested List Iterator
332 Hard Reconstruct Itinerary
329 Hard Longest Increasing Path in a Matrix
326 Easy Power of Three
322 Med. Coin Change
290 Easy Word Pattern
287 Med. Find the Duplicate Number
284 Med. Peeking Iterator
283 Easy Move Zeroes
279 Med. Perfect Squares
278 Easy First Bad Version
268 Easy Missing Number
264 Med. Ugly Number II
263 Easy Ugly Number
246 Easy Strobogrammatic Number
238 Easy Product of Array Except Self
234 Easy Palindrome Linked List
232 Easy Implement Queue using Stacks
228 Easy Summary ranges
206 Easy Reverse Linked List
200 Med. Number of Islands
193 Easy Valid Phone Numbers
191 Easy Number of 1 Bits
169 Easy Majority Element
167 Easy Two Sum II - Input array is sorted
166 Med. Fraction to Recurring Decimal
165 Med. Compare Version Numbers
162 Med. Find Peak Element
160 Easy Intersection of Two Linked Lists
154 Hard Find Minimum in Rotated Sorted Array II
153 Med. Find Minimum in Rotated Sorted Array
150 Med. Evaluate Reverse Polish Notation
149 Hard Max Points on a Line
146 Med. LRU Cache
144 Easy Binary Tree Preorder Traversal
134 Med. Gas Station
131 Med. Palindrome Partitioning
125 Easy Valid Palindrome
122 Med. Best Time to Buy and Sell Stock II
120 Med. 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 Med. Binary Tree Level Order Traversal II
106 Med. Construct Binary Tree from Inorder and Postorder Traversal
105 Med. Construct Binary Tree from Preorder and Inorder Traversal
104 Easy Maximum Depth of Binary Tree
103 Med. Binary Tree Zigzag Level Order Traversal
102 Med. Binary Tree Level Order Traversal
101 Easy Symmetric Tree
100 Easy Same Tree
99 Med. Recover Binary Search Tree
98 Med. Validate Binary Search Tree
97 Med. Interleaving String
96 Med. Unique Binary Search Trees
95 Med. Unique Binary Search Trees II
94 Med. Binary Tree Inorder Traversal
93 Med. Restore IP Addresses
92 Med. Reverse Linked List II
91 Med. Decode Ways
90 Med. Subsets II
89 Med. Gray Code
88 Easy Merge Sorted Array
87 Hard Scramble String
86 Med. Partition List
85 Hard Maximal Rectangle
84 Hard Largest Rectangle in Histogram
83 Easy Remove Duplicates from Sorted List
82 Med. Remove Duplicates from Sorted List II
81 Med. Search in Rotated Sorted Array II
80 Med. Remove Duplicates from Sorted Array II
79 Med. Word Search
78 Med. Subsets
77 Med. Combinations
76 Hard Minimum Window Substring
75 Med. Sort Colors
74 Med. Search a 2D Matrix
73 Med. Set Matrix Zeroes
72 Med. Edit Distance
71 Med. 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 Med. Minimum Path Sum
63 Med. Unique Paths II
62 Med. Unique Paths
61 Med. Rotate List
60 Hard Permutation Sequence
59 Med. Spiral Matrix II
58 Easy Length of Last Word
57 Med. Insert Interval
56 Med. Merge Intervals
55 Med. Jump Game
54 Med. Spiral Matrix
53 Easy Maximum Subarray
52 Hard N-Queens II
51 Hard N-Queens
50 Med. Pow(x, n)
49 Med. Group Anagrams
48 Med. Rotate Image
47 Med. Permutations II
46 Med. Permutations
45 Med. Jump Game II
44 Hard Wildcard Matching
43 Med. Multiply Strings
42 Hard Trapping Rain Water
41 Hard First Missing Positive
40 Med. Combination Sum II
39 Med. Combination Sum
38 Easy Count and Say
37 Hard Sudoku Solver
36 Med. Valid Sudoku
35 Easy Search Insert Position
34 Med. Find First and Last Position of Element in Sorted Array
33 Med. Search in Rotated Sorted Array
32 Hard Longest Valid Parentheses
31 Med. Next Permutation
30 Hard Substring with Concatenation of All Words
29 Med. 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 Med. Swap Nodes in Pairs
23 Hard Merge k Sorted Lists
22 Med. Generate Parentheses
21 Easy Merge Two Sorted Lists
20 Easy Valid Parentheses
19 Med. Remove Nth Node From End of List
18 Med. 4Sum
17 Med. Letter Combinations of a Phone Number
16 Med. 3Sum Closest
15 Med. 3Sum
14 Easy Longest Common Prefix
13 Easy Roman To Integer
12 Med. Integer to Roman
11 Med. Container With Most Water
10 Hard Regular Expression Matching
9 Easy Palindrome Number
8 Med. String to Integer (atoi)
7 Easy Reverse Integer
6 Med. ZigZag Conversion
5 Med. Longest Palindromic Substring
4 Hard Median of Two Sorted Arrays
3 Med. Longest Substring Without Repeating Characters
2 Med. Add Two Numbers
1 Easy Two Sum

About

Solutions of LeetCode's problems.

Resources

Stars

Watchers

Forks