Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

551 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฉ LeetCode Solutions by Hardik Runwal

This repository contains my solutions to various LeetCode problems.
All solutions are written in a clean, easy-to-understand style โ€” some in Python, some in Java, depending on the problem.


๐Ÿ“š Index of Solutions

# Question ID Question Name Problem Solution
1 1 1 Two Sum Problem two-sum.java
2 1 1 Two Sum Cpp Problem two-sum.cpp
two-sum.py
3 100 100 Same Tree Problem same-tree.py
4 104 104 Maximum Depth Of Binary Tree Problem maximum-depth-of-binary-tree.py
5 1064 1064 Smallest Integer Divisible By K Problem smallest-integer-divisible-by-k.py
6 1071 1071 Binary Prefix Divisible By 5 Problem -
7 108 108 Convert Sorted Array To Binary Search Tree Problem convert-sorted-array-to-binary-search-tree.cpp
8 11 11 Container With Most Water Problem container-with-most-water.py
9 1127 1127 Last Stone Weight Problem last-stone-weight.cpp
10 118 118 Pascal'Striangle - View Code
11 1205 1205 Defanging An Ip Address Problem defanging-an-ip-address.py
12 121 121 Best Time To Buy And Sell Stock Problem best-time-to-buy-and-sell-stock.java
13 121 121 Best Time To Buy And Sell Stock Py Problem best-time-to-buy-and-sell-stock.py
14 125 125 Validpalindrome - View Code
15 1266 1266 Minimumtimevisitingallpoints - View Code
16 1353 1353 Find Resultant Array After Removing Anagrams Problem find-resultant-array-after-removing-anagrams.java
find-resultant-array-after-removing-anagrams.py
17 136 136 Single Number Problem single-number.java
18 1365 1365 Howmanynumbersaresmallerthanthecurrentnumber - View Code
19 1388 1388 Greatest Sum Divisible By Three Problem greatest-sum-divisible-by-three.py
20 1395 1395 Minimum Time Visiting All Points Problem minimum-time-visiting-all-points.cpp
21 13 13 Romantointeger - View Code
22 1402 1402 Count Square Submatrices With All Ones Problem count-square-submatrices-with-all-ones.py
23 141 141 Linked List Cycle Problem -
24 142 142 Linked List Cycle Ii Problem -
25 143 143 Reorder List Problem -
26 144 144 Binary Tree Preorder Traversal Problem -
27 1440 1440 Convert Integer To The Sum Of Two No Zero Integers Problem convert-integer-to-the-sum-of-two-no-zero-integers.py
28 1448 1448 Maximum 69 Number Problem maximum-69-number.py
29 148 148 Sort List Problem -
30 1482 1482 How Many Numbers Are Smaller Than The Current Number Problem how-many-numbers-are-smaller-than-the-current-number.cpp
31 149 149 Max Points On A Line Problem max-points-on-a-line.py
32 14 14 Longestcommonprefix - View Code
33 15 15 3Sum Problem 3sum.py
34 150 150 Evaluatereversepolishnotation - View Code
35 153 153 Find Minimum In Rotated Sorted Array Problem find-minimum-in-rotated-sorted-array.py
36 1552 1552 Build An Array With Stack Operations Problem build-an-array-with-stack-operations.cpp
37 155 155 Minstack - View Code
38 1570 1570 Final Prices With A Special Discount In A Shop Problem -
39 1580 1580 Shuffle The Array Problem shuffle-the-array.cpp
40 160 160 Intersection Of Two Linked Lists Problem -
41 1603 1603 Running Sum Of 1D Array Problem running-sum-of-1d-array.py
42 1635 1635 Number Of Good Pairs Problem number-of-good-pairs.py
43 167 167 Twosum Ii Inputarrayissorted - View Code
44 169 169 Majority Element Problem majority-element.java
45 172 172 Factorialtrailingzeroes - View Code
46 1742 1742 Widest Vertical Area Between Two Points Containing No Points Problem widest-vertical-area-between-two-points-containing-no-points.py
47 1791 1791 Richest Customer Wealth Problem richest-customer-wealth.py
48 1797 1797 Goal Parser Interpretation Problem goal-parser-interpretation.py
49 17 17 Lettercombinationsofaphonenumber - View Code
50 1802 1802 Number Of Students Unable To Eat Lunch Problem number-of-students-unable-to-eat-lunch.cpp
51 1806 1806 Count Of Matches In Tournament Problem count-of-matches-in-tournament.py
52 1817 1817 Calculate Money In Leetcode Bank Problem calculate-money-in-leetcode-bank.py
53 189 189 Rotate Array Problem rotate-array.py
54 1894 1894 Merge Strings Alternately Problem merge-strings-alternately.cpp
55 1895 1895 Minimum Number Of Operations To Move All Balls To Each Box Problem minimum-number-of-operations-to-move-all-balls-to-each-box.py
56 19 19 Remove Nth Node From End Of List Problem -
57 1 1 Twosum - View Code
58 2 2 Add Two Numbers Problem -
59 20 20 Valid Parentheses Problem valid-parentheses.py
60 202 202 Happy Number Problem happy-number.py
61 2037 2037 Count Square Sum Triples Problem count-square-sum-triples.py
62 2048 2048 Build Array From Permutation Problem build-array-from-permutation.py
63 205 205 Isomorphic Strings Problem isomorphic-strings.py
64 2050 2050 Count Good Numbers Problem count-good-numbers.py
65 2058 2058 Concatenation Of Array Problem -
66 206 206 Reverse Linked List Problem -
67 20 20 Validparentheses - View Code
68 2137 2137 Final Value Of Variable After Performing Operations Problem final-value-of-variable-after-performing-operations.py
69 217 217 Containsduplicates - View Code
70 2195 2195 Time Needed To Buy Tickets Problem time-needed-to-buy-tickets.cpp
71 21 21 Mergetwosortedlists - View Code
72 2216 2216 Delete The Middle Node Of A Linked List Problem -
73 2219 2219 Maximum Number Of Words Found In Sentences Problem maximum-number-of-words-found-in-sentences.py
74 223 223 Rectangle Area Problem rectangle-area.py
75 2244 2244 Number Of Laser Beams In A Bank Problem number-of-laser-beams-in-a-bank.py
76 2264 2264 Largest3Samedigitnumberinstring - View Code
77 2265 2265 Partition Array According To Given Pivot Problem partition-array-according-to-given-pivot.py
78 2271 2271 Rearrange Array Elements By Sign Problem rearrange-array-elements-by-sign.java
79 2274 2274 Keep Multiplying Found Values By Two Problem keep-multiplying-found-values-by-two.py
80 229 229 Majority Element Ii Problem majority-element-ii.py
81 232 232 Implement Queue Using Stacks Problem implement-queue-using-stacks.cpp
82 234 234 Palindrome Linked List Problem -
83 237 237 Delete Node In A Linked List Problem -
84 238 238 Product Of Array Except Self Problem product-of-array-except-self.py
85 238 238 Productofarrayexceptself - View Code
86 2396 2396 Strictlypalindromicnumber - View Code
87 2423 2423 Removelettertoequalizefrequency - View Code
88 242 242 Validanagram - View Code
89 2491 2491 Smallest Even Multiple Problem smallest-even-multiple.py
90 2556 2556 Convert The Temperature Problem convert-the-temperature.py
91 2591 2591 Distributemoneytomaximumchildren - View Code
92 26 26 Remove Duplicates From Sorted Array Problem remove-duplicates-from-sorted-array.py
93 2631 2631 Sort The Students By Their Kth Score Problem sort-the-students-by-their-kth-score.py
94 268 268 Missingnumbers - View Code
95 27 27 Remove Element Problem remove-element.java
96 2714 2714 Left And Right Sum Differences Problem left-and-right-sum-differences.py
97 2724 2724 Convert An Array Into A 2D Array With Conditions Problem convert-an-array-into-a-2d-array-with-conditions.py
98 28 28 Find The Index Of The First Occurrence In A String Problem find-the-index-of-the-first-occurrence-in-a-string.py
99 2812 2812 Find The Maximum Achievable Number Problem find-the-maximum-achievable-number.py
100 283 283 Move Zeroes Problem move-zeroes.java
101 2894 2894 Divisibleandnondivisiblesumsdifference - View Code
102 29 29 Divide Two Integers Problem divide-two-integers.py
103 2903 2903 Insert Greatest Common Divisors In Linked List Problem -
104 2917 2917 Count Pairs Whose Sum Is Less Than Target Problem count-pairs-whose-sum-is-less-than-target.py
105 31 31 Next Permutation Problem next-permutation.py
106 3110 3110 Scoreofastring - View Code
107 312 312 Burst Balloons Problem burst-balloons.py
108 3194 3194 Find Words Containing Character Problem find-words-containing-character.py
109 324 324 Wigglesortii - View Code
110 3251 3251 Maximum Area Of Longest Diagonal Rectangle Problem maximum-area-of-longest-diagonal-rectangle.java
111 328 328 Odd Even Linked List Problem -
112 33 33 Search In Rotated Sorted Array Problem search-in-rotated-sorted-array.py
113 3371 3371 Harshad Number Problem harshad-number.py
114 34 34 Find First And Last Position Of Element In Sorted Array Problem find-first-and-last-position-of-element-in-sorted-array.py
115 342 342 Power Of Four Problem power-of-four.py
116 342 342 Poweroffour - View Code
117 3446 3446 Find The Number Of Good Pairs I Problem find-the-number-of-good-pairs-i.py
118 3476 3476 Find Minimum Operations To Make All Elements Divisible By Three Problem find-minimum-operations-to-make-all-elements-divisible-by-three.py
119 347 347 Topkfrequentelements - View Code
120 3567 3567 Convert Date To Binary Problem convert-date-to-binary.py
121 3581 3581 The Two Sneaky Numbers Of Digitville Problem the-two-sneaky-numbers-of-digitville.py
122 3582 3582 Find Indices Of Stable Mountains Problem find-indices-of-stable-mountains.py
123 373 373 Find K Pairs With Smallest Sums Problem find-k-pairs-with-smallest-sums.cpp
124 3748 3748 Sort Matrix By Diagonals Problem sort-matrix-by-diagonals.java
125 3778 3778 Transform Array By Parity Problem transform-array-by-parity.py
126 3811 3811 Reverse Degree Of A String Problem reverse-degree-of-a-string.py
127 3830 3830 Find Closest Person Problem find-closest-person.py
128 4008 4008 Restore Finishing Order Problem restore-finishing-order.py
129 4058 4058 Compute Alternating Sum Problem compute-alternating-sum.py
130 4080 4080 Smallest Missing Multiple Of K Problem smallest-missing-multiple-of-k.py
131 42 42 Trapping Rain Water Problem trapping-rain-water.py
132 448 448 Find All Numbers Disappeared In An Array Problem find-all-numbers-disappeared-in-an-array.cpp
133 451 451 Sort Characters By Frequency Problem sort-characters-by-frequency.py
134 455 455 Assign Cookies Problem assign-cookies.py
135 48 48 Rotate Image Problem rotate-image.java
136 485 485 Max Consecutive Ones Problem max-consecutive-ones.py
137 49 49 Groupanagrams - View Code
138 5 5 Longest Palindromic Substring Problem longest-palindromic-substring.py
139 50 50 Pow X,N -
140 53 53 Maximum Subarray Problem maximum-subarray.java
141 54 54 Spiralmatrix - View Code
142 56 56 Merge Intervals Problem merge-intervals.py
143 560 560 Subarray Sum Equals K Problem subarray-sum-equals-k.py
144 58 58 Length Of Last Word Problem length-of-last-word.py
145 5 5 Longestpalindromicsubstring - View Code
146 60 60 Permutation Sequence Problem permutation-sequence.py
147 636 636 Exclusive Time Of Functions Problem exclusive-time-of-functions.cpp
148 645 645 Set Mismatch Problem set-mismatch.cpp
149 65 65 Validnumber - View Code
150 66 66 Plus One Problem plus-one.py
151 68 68 Text Justification Problem text-justification.java
152 69 69 Sqrtx Problem sqrtx.py
153 7 7 Reverse Integer Problem reverse-integer.py
154 73 73 Set Matrix Zeroes Problem set-matrix-zeroes.java
155 739 739 Daily Temperatures Problem daily-temperatures.cpp
156 74 74 Search A 2D Matrix Problem search-a-2d-matrix.py
157 75 75 Sort Colors Problem sort-colors.java
158 78 78 Subsets Problem subsets.py
159 782 782 Jewels And Stones Problem -
160 8 8 String To Integer Atoi Problem string-to-integer-atoi.py
161 808 808 Soupservings - View Code
162 825 825 Max Increase To Keep City Skyline Problem max-increase-to-keep-city-skyline.py
163 84 84 Largest Rectangle In Histogram Problem largest-rectangle-in-histogram.cpp
164 867 867 New 21 Game Problem new-21-game.py
165 869 869 Reorderedpowerof2 - View Code
166 88 88 Merge Sorted Array Problem merge-sorted-array.py
167 9 9 Palindrome Number Problem palindrome-number.cpp
168 907 907 Koko Eating Bananas Problem koko-eating-bananas.py
169 908 908 Middle Of The Linked List Problem -
170 908 908 Middle Of The Linked List Cpp Problem middle-of-the-linked-list.cpp
171 909 909 Stone Game Problem stone-game.java
172 90 90 Subsetsii - View Code
173 93 93 Restore Ip Addresses Problem restore-ip-addresses.cpp
174 932 932 Monotonic Array Problem monotonic-array.java
175 9 9 Palindromenumber - View Code
176 - Solutions - -

(Click on View Code to open the file in GitHub.)


๐Ÿš€ How to Use

  1. Clone the repository
    git clone https://github.com/HardikLovesTech/LeetCodeSolutions.git
    

About

This is a repository where i will be uploading all my github solutions in order to maintain them. Also the solutions can be refered by anyone in need.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages