Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
350 commits
Select commit Hold shift + click to select a range
9e3b77f
Merge pull request #269 from Harshvartak/master
vJechsmayr Oct 4, 2020
db8f557
Merge pull request #278 from jmdana/feature/0020_Valid_Parentheses
vJechsmayr Oct 4, 2020
555fa8b
Solution for 0017_Letter_Combinations_of_a_Phone_Number
jmdana Oct 4, 2020
458a8ac
Merge pull request #281 from jmdana/feature/0017_Letter_Combinations_…
vJechsmayr Oct 4, 2020
8b129b5
Fix the solution for "0383 - Ransom Note" problem
Oct 4, 2020
e63154a
Merge pull request #274 from GiorgiBeriashvili/feature/ransom-note
vJechsmayr Oct 4, 2020
c91fa1e
Added Range Sum of BST
Arihant416 Oct 5, 2020
b223c01
just a few readability improvements
ChillOutFlim Oct 5, 2020
4f2f6ae
Added newline at end of file
anuranjanpandey Oct 5, 2020
069354d
Update 0060 - Permutation_Sequence.py
sourabmaity Oct 5, 2020
8aa0cae
1288 - Remove Covered Intervals
anuranjanpandey Oct 5, 2020
6ac893b
0078_Subsets.py
stoicfeats Oct 5, 2020
2672237
Added the solution for "0058 - Length of Last Word" problem
wjyeap123 Oct 5, 2020
37655bd
Added solution for 0728-Self Dividing Numbers
YashNagare Oct 5, 2020
bb1d6af
0567_Permutations_in_String.py added
mansisahu127 Oct 5, 2020
c4a9921
Add solutions to Linked List Cycle
Oct 5, 2020
e021362
0567_Permutations_in_String.py added
mansisahu127 Oct 5, 2020
c0f1859
Merge pull request #285 from Arihant416/0938_RangeSumOfBST
vJechsmayr Oct 5, 2020
7ab9ba7
Merge pull request #305 from YashNagare/feature/self-dividing-numbers
vJechsmayr Oct 5, 2020
465df42
Merge pull request #296 from busybee23/master
vJechsmayr Oct 5, 2020
f158ce7
Merge pull request #302 from Ayushmanglani/master
vJechsmayr Oct 5, 2020
00a9888
Merge pull request #307 from Calm-23/feature/Permutations_in_string
vJechsmayr Oct 5, 2020
88deeb2
Merge pull request #306 from FergusYip/0141_Linked_List_Cycle
vJechsmayr Oct 5, 2020
97c9ae6
Merge pull request #287 from ChillOutFlim/patch-1
vJechsmayr Oct 5, 2020
870a52b
Merge pull request #210 from SOURAB-BAPPA/permutationSeq
vJechsmayr Oct 5, 2020
acda2ab
Solution to 0121_Best_Time_to_Buy_and_Sell_Stock solves issue #291
amoghrajesh Oct 5, 2020
41adc2f
Add Gas Station Problem
tejasbirsingh Oct 5, 2020
24cdfe0
Merge pull request #272 from anuranjanpandey/master
vJechsmayr Oct 5, 2020
ab9e85d
Add files via upload
PrachiSinghal86 Oct 5, 2020
0a11682
Solution of 0746
PrachiSinghal86 Oct 5, 2020
420f630
0347_Top K Frequent Elements.py
stoicfeats Oct 5, 2020
86b8cb3
Rename 0347_Top K Frequent Elements.py to 0347_Top_K_Frequent_Element…
stoicfeats Oct 5, 2020
0699841
Create 0086_Partition_List.py
stoicfeats Oct 5, 2020
49ff5da
Create 0098_Validate_Binary_Search_Tree.py
LenartBucar Oct 5, 2020
f612c41
solution.py
gaom25 Oct 5, 2020
b552f00
closes #342
DhawalKhapre Oct 5, 2020
b844f3a
Solve Leet Code problem 0414
riwim Oct 5, 2020
8b5605a
added problem 0231
rsconsuegra Oct 5, 2020
417e556
Added 0079_Word_Search.py
OfiliPatrick Oct 6, 2020
17c264f
added codes for problem 1592
Oct 6, 2020
ee72d79
improved runtime efficiency
Oct 6, 2020
1eea50b
added codes for problem 1494
Oct 6, 2020
dfcbe9d
Added Solution to Problem 13 Roman to Integer
Oct 6, 2020
d509856
Merge pull request #326 from wjyeap123/feature/length-of-last-word
vJechsmayr Oct 6, 2020
14c85f2
Merge pull request #317 from amoghrajesh/master
vJechsmayr Oct 6, 2020
60fd465
Merge pull request #316 from tejasbirsingh/gasStation
vJechsmayr Oct 6, 2020
cc57a3f
Merge pull request #339 from busybee23/master
vJechsmayr Oct 6, 2020
82672ad
Solution to 0299_Bulls_and_Cows solves issue #334
amoghrajesh Oct 6, 2020
7f03a91
Merge pull request #321 from PrachiSinghal86/master
vJechsmayr Oct 6, 2020
3796ffd
Added 1009_Complement_of_base_10_integer.py
anuranjanpandey Oct 6, 2020
d45257e
Merge pull request #329 from adi0311/master
Oct 6, 2020
3b287eb
Update README.md
vJechsmayr Oct 6, 2020
b5f6c1b
Merge pull request #350 from LenartBucar/master
vJechsmayr Oct 6, 2020
1afc149
Merge pull request #351 from ovasgus/feature/pascal_triangle
vJechsmayr Oct 6, 2020
a86bce2
Added the solution with time complexity of O(len(a) + len(b))
spoorgholi Oct 6, 2020
1c36970
Merge pull request #376 from riwim/feature/third-maximum-number
vJechsmayr Oct 6, 2020
1f634d1
Merge pull request #386 from OfiliPatrick/OfiliPatrick
vJechsmayr Oct 6, 2020
90590c7
Merge pull request #377 from rsconsuegra/master
vJechsmayr Oct 6, 2020
3861500
Merge pull request #389 from wanda15tw/feature/1592
vJechsmayr Oct 6, 2020
02dce1b
Merge pull request #390 from wanda15tw/feature/1494
vJechsmayr Oct 6, 2020
46e5df5
Merge pull request #393 from anupamabauri/master
vJechsmayr Oct 6, 2020
8f3e17e
Merge pull request #396 from amoghrajesh/master
vJechsmayr Oct 6, 2020
c399196
Merge pull request #397 from anuranjanpandey/master
vJechsmayr Oct 6, 2020
44a8204
Added Solution to Problem 88 Merge Sorted Array
Oct 6, 2020
58a23bd
Add House Robber 2
tejasbirsingh Oct 6, 2020
65c4550
Added 0268_Missing_Number.py
AkshatBhat Oct 6, 2020
c88ab09
solved strstr
devanshi-katyal Oct 6, 2020
107672f
Added solution for StrStr
devanshi-katyal Oct 6, 2020
ab7e0f8
Added 0036_Valid_Sudoku.py
Swarn10 Oct 6, 2020
9cce324
Added a solution to LeetCode-0022
c-utkarsh Oct 6, 2020
bbb68db
0561_Array_Partition_I.py
Oct 6, 2020
f7a4ae5
Added Python code for problem 0125-Valid Palindrome #354
afeefaa333 Oct 6, 2020
08ba7b7
Added 1480_Running_Sum_of_1a_Array.py
Vineet-Dhaimodker Oct 6, 2020
9d99b97
Merge pull request #1 from Vineet-Dhaimodker/feature/vineetsbranch
Vineet-Dhaimodker Oct 6, 2020
5e09690
0832_Flipping_an_Image
ishika161 Oct 6, 2020
66ccfbd
1380_Lucky_Numbers_in_a_Matrix
ishika161 Oct 6, 2020
94b169e
Added 1431_Kids_With_the_Greatest_Number_of_Candies.py
Vineet-Dhaimodker Oct 6, 2020
57c728b
Delete 1380_Lucky_Numbers_in_a_Matrix.py
ishika161 Oct 6, 2020
07b5dfd
1380_Lucky_Numbers_in_a_Matrix
ishika161 Oct 6, 2020
3c1494f
1374_Generate_a_String_With_Characters_That_Have_Odd_Counts
ishika161 Oct 6, 2020
0a2b900
1374_Generate_a_String_With_Characters_That_Have_Odd_Counts
ishika161 Oct 6, 2020
8209cce
Added 0102_Binary_Tree_Level_Order_Traversal.py
OfiliPatrick Oct 6, 2020
6ccaba5
Added 198 - House Robber
anusharp97 Oct 6, 2020
38b1e3b
Added 1605_Find_Valid_Matrix_Given_Row_and_Column_Sum
TrushaT Oct 6, 2020
91977b6
Added H-Index
anusharp97 Oct 6, 2020
dc573f0
added algorithm for 1582
chw9 Oct 6, 2020
2695616
Added LeetCode 0063 - Unique Paths II
c-utkarsh Oct 6, 2020
8743a40
Create 0973_ K_Closest_Points_to_Origin.py
Martmists-GH Oct 6, 2020
cb769b4
0043 - Multiply Strings
dennis-pg Oct 6, 2020
05bf50e
Solution 0104 Maximum Depth of Binary Tree
Oct 6, 2020
dca6e06
Solve Leet Code problem 0500 "Keyboard Row"
riwim Oct 6, 2020
d7a9014
Added Solution for problem 0279-PerfectSquares
anirudhvsp Oct 7, 2020
4f5d048
Create 0010_Regular_Expression_Matching.py
rajapuranam Oct 7, 2020
0697644
1023_Camelcase_Matching
Rollerss Oct 7, 2020
8b4c402
Added Solution to Problem 47 Permutations II
Oct 7, 2020
38ec217
Removed Solution to Problem 47 Permutations II
Oct 7, 2020
4058361
Added Solution to Problem 47 PermutationsII
Oct 7, 2020
3e4dc91
Number of islands solution
Oct 7, 2020
32711d3
Merge pull request #402 from anupamabauri/master
vJechsmayr Oct 7, 2020
94d2f6a
Merge pull request #411 from OfiliPatrick/OfiliPatrick
vJechsmayr Oct 7, 2020
a7278aa
Update submit-a-leetcode-problem.md
vJechsmayr Oct 7, 2020
8af6b78
Merge pull request #427 from dennis-pg/master
vJechsmayr Oct 7, 2020
fdc1655
Merge pull request #431 from riwim/feature/keyboard-row
vJechsmayr Oct 7, 2020
1f3133a
SAME TREE #100
shubhamc1200 Oct 7, 2020
a07a525
1108_Defanging_an_IP_Address
AshishVarshneyy Oct 7, 2020
8634595
added algorithm for 0367
chw9 Oct 7, 2020
0b9f62e
added 0112_Path_Sum
HOD101s Oct 7, 2020
40ed8cb
1189 - Maximum Numer of Ballons
ralph44 Oct 7, 2020
8966766
added 1460_Make_Two_Arrays_Equal_by_Reversing_Sub_Arrays
HOD101s Oct 7, 2020
421e1bc
added 1441_build_an_array_with_stack_operations
HOD101s Oct 7, 2020
e9a315e
closes issue#435
anirudhvsp Oct 7, 2020
bb0e02e
Merge branch 'master' of https://github.com/anirudhvsp/PythonAlgorith…
anirudhvsp Oct 7, 2020
c7a3e88
closes #435
anirudhvsp Oct 7, 2020
089a650
Merge branch 'master' of https://github.com/anirudhvsp/PythonAlgorith…
anirudhvsp Oct 7, 2020
f9fc9c2
solution accepted in Leetcode
GorettiRivera Oct 7, 2020
496a0a2
Corrected 0043_Multiply_Strings
Dave-Browne Oct 7, 2020
41b265b
Added 0080 solution
Dave-Browne Oct 7, 2020
35e75c9
Added 0082 Solution
Dave-Browne Oct 7, 2020
a3e8634
jump game accepted
shanirub Oct 7, 2020
fa3cc1a
Solved integer break
tothmiklos99 Oct 7, 2020
b60c2dc
Create 0051_N-Queen_1.py
Oct 8, 2020
bf20290
Create 1103_Distributing_Candies_to_people.py
daivikpurani Oct 8, 2020
f45e75b
added Majority Element number 169
tzvog Oct 8, 2020
048e1fc
Split_ a_String_in_Balanced_Strings.py
trip-mahak Oct 8, 2020
63af736
Added 0257_Binary_Tree_Paths.py
matheusphalves Oct 8, 2020
d3f8a39
Adding 1018 Binary Tree Prefix Divisible By 5
TheOrangePuff Oct 8, 2020
3a06bc0
Create 1053_Previous_Permutation_With_One_Swap.py
frank731 Oct 9, 2020
6592372
add 0237
rkkksss Oct 9, 2020
114d78d
Solves Issue #35
DhawalKhapre Oct 9, 2020
c6e6e71
Delete 0041_findingLeastPositiveNumber.py
vJechsmayr Oct 9, 2020
6b73bd6
Merge pull request #494 from devanshi-katyal/master
vJechsmayr Oct 9, 2020
c8c3a9f
Merge pull request #407 from ishika161/ishika161-patch-1-1
vJechsmayr Oct 9, 2020
8548bae
Merge pull request #399 from ishika161/master
vJechsmayr Oct 9, 2020
1d761d7
added solution for issue 0701
anshul17024 Oct 9, 2020
7545fea
Merge pull request #400 from Vineet-Dhaimodker/master
vJechsmayr Oct 9, 2020
49a6a74
added solution for issue 0701
anshul17024 Oct 9, 2020
b0a54d9
Merge pull request #460 from HOD101s/0112_Path_Sum
vJechsmayr Oct 9, 2020
3c42c4c
Delete 0043_Multiply_Strings.py
vJechsmayr Oct 9, 2020
e9f555d
Merge pull request #470 from Dave-Browne/feature/0080_Remove_Duplicates
vJechsmayr Oct 9, 2020
c468441
Merge pull request #438 from Rollerss/master
vJechsmayr Oct 9, 2020
81cf650
Delete 0080_Remove_Duplicates_from_Sorted_Array_II.py
vJechsmayr Oct 9, 2020
3220383
Delete 0043_Multiply_Strings.py
vJechsmayr Oct 9, 2020
d24a5a8
Merge pull request #471 from Dave-Browne/feature/0082_Remove_Duplicates
vJechsmayr Oct 9, 2020
31371a9
Merge pull request #475 from tothmiklos99/feature/intbreak
vJechsmayr Oct 9, 2020
8c9c319
Added code for problem 0125.Valid Palindromes
AditSoni Oct 9, 2020
f14b949
Merge pull request #485 from tzvog/master
vJechsmayr Oct 9, 2020
c8aa027
Merge pull request #504 from TheOrangePuff/feature/1018_binary_prefix…
vJechsmayr Oct 9, 2020
f508a3e
Merge pull request #505 from frank731/master
vJechsmayr Oct 9, 2020
9f92ded
Merge pull request #512 from rkkksss/0237
vJechsmayr Oct 9, 2020
c3c01b6
Merge pull request #467 from anirudhvsp/master
vJechsmayr Oct 9, 2020
9276bdf
Merge pull request #398 from tejasbirsingh/houseRobber
vJechsmayr Oct 9, 2020
9e9559e
Merge pull request #401 from afeefaa333/valid_palindrome
vJechsmayr Oct 9, 2020
81e4b59
Merge pull request #403 from AkshatBhat/0268_Missing_Number
vJechsmayr Oct 9, 2020
a82a97f
Delete 1480_Running_Sum_of_1d_Array.py
vJechsmayr Oct 9, 2020
7411aaa
Merge pull request #404 from Vineet-Dhaimodker/feature/vineets2ndbranch
vJechsmayr Oct 9, 2020
c270f37
Merge pull request #408 from ishika161/ishika161-patch-2
vJechsmayr Oct 9, 2020
c24967f
bad write
AditSoni Oct 9, 2020
1707a11
Merge pull request #410 from h5jam/master
vJechsmayr Oct 9, 2020
e48dfe8
Merge pull request #412 from anusharp97/feature/LC198
vJechsmayr Oct 9, 2020
3b25489
Merge pull request #413 from TrushaT/add-1605-code
vJechsmayr Oct 9, 2020
d65aa22
Merge pull request #414 from anusharp97/feature/LC274
vJechsmayr Oct 9, 2020
6de6147
Merge pull request #416 from chw9/feature/1582
vJechsmayr Oct 9, 2020
38cd709
Merge pull request #417 from c-utkarsh/feature/add-0022
vJechsmayr Oct 9, 2020
4796ca9
Added code for problem 93 restore ip address
AditSoni Oct 9, 2020
140e746
Merge pull request #418 from c-utkarsh/feature/add-0063
vJechsmayr Oct 9, 2020
d189280
Merge pull request #429 from ExpectoPatrom/104Maximum-DepthBT
vJechsmayr Oct 9, 2020
c55c1d2
Merge pull request #434 from Swarn10/sudoku
vJechsmayr Oct 9, 2020
fef6309
Merge pull request #436 from rajapuranam/patch-2
vJechsmayr Oct 9, 2020
14b18c2
Merge pull request #447 from spoorgholi74/feature/0888_Fair_Candy_Swap
vJechsmayr Oct 9, 2020
8c976ba
Delete 0088_Merge Sorted Array.py
vJechsmayr Oct 9, 2020
e3bf02e
Merge pull request #453 from anupamabauri/feature/Permutation
vJechsmayr Oct 9, 2020
f04dfa9
Merge pull request #455 from adi0311/master
vJechsmayr Oct 9, 2020
9412d36
Merge pull request #456 from shubhamc1200/master
vJechsmayr Oct 9, 2020
f836f3d
Merge pull request #457 from mkiglics/feature/number_of_islands
vJechsmayr Oct 9, 2020
310b1ca
Merge pull request #458 from AshishVarshneyy/master
vJechsmayr Oct 9, 2020
3c33585
Merge pull request #459 from chw9/feature/367
vJechsmayr Oct 9, 2020
4657086
Merge pull request #461 from ralph44/1189---Maximum-Number-of-Ballons
vJechsmayr Oct 9, 2020
d40a4dc
Merge pull request #462 from HOD101s/1460_two_arrays_equal
vJechsmayr Oct 9, 2020
8699ccd
Merge pull request #465 from HOD101s/1441_array_stack_ops
vJechsmayr Oct 9, 2020
61c95ed
Merge pull request #468 from GorettiRivera/1249_MinimumRemove
vJechsmayr Oct 9, 2020
42e5af2
Merge pull request #472 from shanirub/master
vJechsmayr Oct 9, 2020
0648426
Revert "Added 0257_Binary_Tree_Paths.py"
matheusphalves Oct 9, 2020
74a8aab
Merge pull request #479 from pikachu28/master
vJechsmayr Oct 9, 2020
0dbf96d
identation error fixed from 0257 LeetCode problem
matheusphalves Oct 9, 2020
851bcc2
Delete 0933_Number_of_recent_calls.py
vJechsmayr Oct 9, 2020
603fe90
Merge pull request #481 from daivikpurani/myBranch
vJechsmayr Oct 9, 2020
f91e113
Merge pull request #491 from trip-mahak/patch-1
vJechsmayr Oct 9, 2020
21d6f28
Merge pull request #501 from matheusphalves/feature/matheusphalves
vJechsmayr Oct 9, 2020
f606e7c
Merge pull request #517 from DhawalKhapre/DhawalKhapre
vJechsmayr Oct 9, 2020
882ae26
Merge pull request #518 from anshul17024/insert
vJechsmayr Oct 9, 2020
7bf8566
Merge pull request #523 from AditSoni/master
vJechsmayr Oct 9, 2020
151d53a
Merge pull request #423 from MaryWeeb/patch-1
vJechsmayr Oct 9, 2020
af24296
moved to LeetCode Folder
vJechsmayr Oct 9, 2020
fdbed32
added 1559_Detect_Cycles_In_2D_Grid.py
soum-sr Oct 9, 2020
cb50045
Create 0448-Find-All-Numbers-Disappeared-in-an-Array.py
sj538 Oct 9, 2020
de916e3
Issue #528: LeetCode task 1160 - 1160. Find Words That Can Be Formed …
dangerworm Oct 9, 2020
5f91696
Add 1499. Max Value of Equation
Oct 9, 2020
a29862a
Add 1250. Check If It Is a Good Array
Oct 9, 2020
975c201
Added a leetcode solution for problem 0091 Decode Ways for hacktoberfest
Oct 10, 2020
97d2729
Add 483. Smallest Good Base
Oct 10, 2020
f8fd6e8
Added Move Zeroes
rkkksss Oct 10, 2020
9cb8026
Added 771 Jewels ans Stones
rkkksss Oct 10, 2020
9dc920f
Addded 258 Add digits
rkkksss Oct 10, 2020
54a69ff
Create 0443_String_Compression.py
frank731 Oct 10, 2020
ffc619f
1603 Design Parking System
LCVcode Oct 10, 2020
88d297c
Adding 0368 - Largest Divisible Subset Problem
sailok Oct 10, 2020
5df8927
added solution to leetcode problem 1137
Karnak123 Oct 10, 2020
045177e
Add House Robber 3 Problem
tejasbirsingh Oct 10, 2020
54b5a18
Adding Kth Largest Element in an Array Solution
OMEGAeNcore Oct 10, 2020
34514b9
Adding 0647 Palindromic Substrings
sailok Oct 10, 2020
daed213
Added problem 190 reverse bits
AditSoni Oct 10, 2020
af4c6ee
added 191 Number of 1 bits
AditSoni Oct 10, 2020
c6ffee1
Create 0043_Multiply Strings.py
SatyamYadav-cmd Oct 10, 2020
f1eaea0
Rename 0523_K_diff_Pairs_in_an_Array.py to 0532_K_diff_Pairs_in_an_Ar…
coffeebenzene Oct 10, 2020
83e49c1
Solution to issue #579
tejasvicsr1 Oct 10, 2020
d5596d4
add: solution to reducing dishes
nainys Oct 10, 2020
5e618b6
Solution to the problem 1470 #584
tejasvicsr1 Oct 10, 2020
8feaafa
Delete 1470_Shuffle_the_array.py
tejasvicsr1 Oct 10, 2020
4e6e98c
Solution to the problem 1470 #584
tejasvicsr1 Oct 10, 2020
4ca12f3
Solution to the problem 1512 #588
tejasvicsr1 Oct 10, 2020
c323f34
Create 0088_Merge_Sorted_Array.py
SatyamYadav-cmd Oct 10, 2020
d76b088
Merge pull request #533 from livace/1250
vJechsmayr Oct 10, 2020
94c3afd
Merge pull request #547 from frank731/master
vJechsmayr Oct 10, 2020
746ae9e
Merge pull request #536 from neaGaze/feature/0091_decode_ways
vJechsmayr Oct 10, 2020
7c9ba2b
Merge pull request #538 from livace/483
vJechsmayr Oct 10, 2020
e6b6a29
Merge pull request #540 from rkkksss/0283
vJechsmayr Oct 10, 2020
cdfddb9
Merge pull request #544 from rkkksss/0771
vJechsmayr Oct 10, 2020
08fab90
Merge pull request #546 from rkkksss/0258
vJechsmayr Oct 10, 2020
2fdbb6a
Merge pull request #552 from sailok/feature/0368_Largest_divisible_su…
vJechsmayr Oct 10, 2020
044b1cc
Merge pull request #551 from LCVcode/master
vJechsmayr Oct 10, 2020
a31e33c
Merge pull request #570 from AditSoni/master
vJechsmayr Oct 10, 2020
16d3094
Merge pull request #583 from SatyamYadav-cmd/master
vJechsmayr Oct 10, 2020
4c5e2a1
Merge pull request #582 from tejasvicsr1/feature/tjsv
vJechsmayr Oct 10, 2020
21b2694
Merge pull request #581 from coffeebenzene/patch-1
vJechsmayr Oct 10, 2020
ba8da0f
Rename 1221
vJechsmayr Oct 10, 2020
68c2aa3
Merge pull request #586 from nainys/master
vJechsmayr Oct 10, 2020
4c05a44
Delete 1480_Running_Sum_of_1d_array.py
vJechsmayr Oct 10, 2020
10891b6
Delete 1470_Shuffle_the_array.py
vJechsmayr Oct 10, 2020
25ee88e
Merge pull request #589 from tejasvicsr1/feature/tjsv3
vJechsmayr Oct 10, 2020
2c9ff3a
Merge pull request #524 from soum-sr/master
vJechsmayr Oct 10, 2020
6af0cfd
Merge pull request #525 from jindalsachin/patch-1
vJechsmayr Oct 10, 2020
386dc70
Merge pull request #529 from dangerworm/feature/1160_FindWordsThatCan…
vJechsmayr Oct 10, 2020
ec1decc
Merge pull request #531 from livace/1499
vJechsmayr Oct 10, 2020
7d744e3
Merge pull request #560 from Karnak123/1137-N-th-Tribonacci-Number
vJechsmayr Oct 10, 2020
141ddf8
Merge pull request #561 from tejasbirsingh/robber3
vJechsmayr Oct 10, 2020
9b8dc7b
Merge pull request #563 from OMEGAeNcore/LeetCode/omega
vJechsmayr Oct 10, 2020
babc379
Merge pull request #565 from sailok/feature/0647_Palindromic_Substrings
vJechsmayr Oct 10, 2020
10b4b16
Added code for 242 Valid Anagram
AditSoni Oct 10, 2020
6d926aa
Merge pull request #596 from AditSoni/master
vJechsmayr Oct 10, 2020
bacb26b
Merge branch 'master' of https://github.com/vJechsmayr/PythonAlgorithms
vJechsmayr Oct 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/pyhtonalgorithms-issues.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/submit-a-leetcode-problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Submit a LeetCode Problem
about: Use this Template to submit a new LeetCode Problem
title: 00## - LeetCode Problem Title
labels: 'hacktoberfest, help wanted, good first issue'
labels: 'hacktoberfest'
assignees: ''

---
Expand Down
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
Please make sure your file is in the `LeetCode`-Folder and Named like this:
`0001_TwoSum.py` -> 4-digit Number of the LeetCode Issue, Underscore, LeetCodeName

## Pull Requests
### Opening Issues
When you open an issue, please make sure the Problem is not already implemented (Look at Code/Leetcode for the Problemnumber).
Opened Issues by existing Problem will be closed & PR made to this Issue marked as **spam**
The Contributer who opened an issue will be assigned prefered to the issue. If there is no PR within about 7 Days the issue will be assigned to another Contributer.

### Pull Requests
Only Pull Requests **joined with an Issue** and matching the **naming-conventions** (See Folders and Files) will be merged!
If there is no Issue joined in the PR your PR will be labeld as **spam** and closed.
If your code don't passes the Check on LeetCode.com your PR will be labeld as **"invalid"** and the Issue stays open for the next PR!
If your code don't passes the Check on LeetCode.com your PR will be labled as **"invalid"** and the Issue stays open for the next PR!
If your PR doesn' follow the Contributing Guidelines of this Repository it will be also marked as **spam** and closed!

## Which PR will be accepted?
## Which PR's will be accepted?
* Ones you are assigned to
* Your PR has to link the Issue
* Your Solution must be correct - you can check ist on LeetCode (submit) if it works on different test-cases
14 changes: 14 additions & 0 deletions LeetCode/0003_Longest_Substring_Without_Repeating_Characters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
map_chars = {}
longest = 0
j = 0

for i in range(0, len(s)):
if s[i] in map_chars.keys():
j = max(j, map_chars[s[i]] + 1)

longest = max(longest, i - j + 1)
map_chars[s[i]] = i

return longest
38 changes: 38 additions & 0 deletions LeetCode/0005_Longest_Palindromic_Substring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'''
Problem:-

Given a string s, find the longest palindromic substring in s.
You may assume that the maximum length of s is 1000.

Example 1:
Input: "babad"
Output: "bab"
Note: "aba" is also a valid answer.

'''

class Solution:
def longestPalindrome(self, s: str) -> str:
res = ""
resLen = 0

for i in range(len(s)):
# odd length
l, r = i, i
while l >= 0 and r < len(s) and s[l] == s[r]:
if (r - l + 1) > resLen:
res = s[l:r + 1]
resLen = r - l + 1
l -= 1
r += 1

# even length
l, r = i, i + 1
while l >= 0 and r < len(s) and s[l] == s[r]:
if (r - l + 1) > resLen:
res = s[l:r + 1]
resLen = r - l + 1
l -= 1
r += 1

return res
26 changes: 26 additions & 0 deletions LeetCode/0008_String_to_Integer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class Solution:
def myAtoi(self, s: str) -> int:
INT_MAX = (1 << 31) - 1
INT_MIN = -(1 << 31)

ret = 0
s = s.strip()

if s == "":
return ret

negate = -1 if s[0] == '-' else 1

if s[0] in ('+', '-'):
s = s[1::]

for c in s:
if not '0' <= c <= '9':
break

ret = ret * 10 + ord(c) - ord('0')

ret *= negate
ret = min(max(ret, INT_MIN), INT_MAX)

return ret
12 changes: 12 additions & 0 deletions LeetCode/0009_Palindrom_Number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution:
def isPalindrome(self, x: int) -> bool:
if x > 0 and x < 10:
return True

copyNumber = x
newNumber = 0
while copyNumber > 0:
newNumber = int(newNumber * 10 + (copyNumber % 10))
copyNumber = int(copyNumber / 10)

return newNumber == x
20 changes: 20 additions & 0 deletions LeetCode/0010_Regular_Expression_Matching.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Solution:
def isMatch(self, s: str, p: str) -> bool:
string, pattern = [], []
string[:0], pattern[:0] = s, p
string.insert(0, 0)
pattern.insert(0, 0)
s, p = len(string), len(pattern)
dp = [[False for _ in range(p)] for __ in range(s)]
dp[0][0] = True
for i in range(p):
if pattern[i] is '*' and dp[0][i-2]: dp[0][i] = True
for i in range(1, s):
for j in range(1, p):
if pattern[j] is string[i] or pattern[j] is '.':
dp[i][j] = dp[i-1][j-1]
elif pattern[j] is '*' and (pattern[j-1] is string[i] or pattern[j-1] is '.'):
dp[i][j] = dp[i][j-2] or dp[i-1][j]
elif pattern[j] is '*' and not (pattern[j-1] is string[i] or pattern[j-1] is '.'):
dp[i][j] = dp[i][j-2]
return dp[s-1][p-1]
16 changes: 16 additions & 0 deletions LeetCode/0011 - Container With Most Water.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Solution(object):
def maxArea(self, height):
i=0
j=len(height)-1
a=0
b=0
while i<j:
if height[i]<height[j]:
b=(j-i)*height[i]
i+=1
else:
b=(j-i)*height[j]
j-=1
if b>a:
a=b
return a
32 changes: 32 additions & 0 deletions LeetCode/0013_Roman to Integer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Solution:
def romanToInt(self, s: str) -> int:

symbolValDict = {
'I':1,
'V':5,
'X':10,
'L':50,
'C':100,
'D':500,
'M':1000
}


i = 0
finalDigit = 0
while(i<len(s)):
firstDigit = symbolValDict[s[i]]
if(i+1 < len(s)):
nextDigit = symbolValDict[s[i+1]]
if firstDigit >= nextDigit:
finalDigit += firstDigit
i+=1
else:
finalDigit += nextDigit - firstDigit
i+=2
else:
finalDigit += firstDigit
i+=1


return finalDigit
19 changes: 19 additions & 0 deletions LeetCode/0017_Letter_Combinations_of_a_Phone_Number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import itertools
from typing import List

class Solution:
def letterCombinations(self, digits: str) -> List[str]:
keyboard = {
'2': "abc",
'3': "def",
'4': "ghi",
'5': "jkl",
'6': "mno",
'7': "pqrs",
'8': "tuv",
'9': "wxyz",
}

pressed = [keyboard[c] for c in digits]

return [''.join(p) for p in itertools.product(*pressed) if p != ()]
16 changes: 16 additions & 0 deletions LeetCode/0020_Valid_Parentheses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Solution:
def isValid(self, s: str) -> bool:
stack = []
openbrackets = ('(', '[', '{')
matches = ('()', '[]', '{}')

for c in s:
if c in openbrackets:
stack.append(c)
else:
if len(stack) < 1 or stack[-1] + c not in matches:
return False

stack.pop()

return len(stack) == 0
25 changes: 25 additions & 0 deletions LeetCode/0022_GenerateParenthesis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
def isValid(s: str) -> bool:
stk = []
for b in s:
if b == '(':
stk.append(b)
else:
if stk and stk[-1] == '(':
stk.pop()
else:
return False
return stk == []

ans = []
for mask in range(1<<(2*n)):
s = ""
for bit in range(2*n):
if mask & (1<<bit):
s += '('
else:
s += ')'
if isValid(s):
ans.append(s)
return ans
27 changes: 27 additions & 0 deletions LeetCode/0024_ Swap_Nodes_in_Pairs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'''
Problem:-

Given a linked list, swap every two adjacent nodes and return its head.
You may not modify the values in the list's nodes, only nodes itself may be changed.

Example:
- Given 1->2->3->4, you should return the list as 2->1->4->3.

'''

# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def swapPairs(self, head: ListNode) -> ListNode:
pre, pre.next = self, head
while pre.next and pre.next.next:
a = pre.next
b = a.next
pre.next, b.next, a.next = b, a, b.next
pre = a
return self.next


22 changes: 22 additions & 0 deletions LeetCode/0028_strStr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class Solution(object):
def strStr(self, haystack, needle):

i = 0
j = 0
m = len(needle)
n = len(haystack)
if m ==0:
return 0
while i<n and n-i+1>=m:
if haystack[i] == needle[j]:
temp = i
while j<m and i<n and needle[j]==haystack[i]:
i+=1
j+=1
if j == m:
return temp
i= temp+1
j = 0
else:
i+=1
return -1
44 changes: 44 additions & 0 deletions LeetCode/0032_Longest_Valid_Parentheses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from typing import List, Dict

class Solution:
def _score(self, position: List[int], state: Dict[int,bool]) -> List[int]:
score = 0
scores = list()
for pos in position:
matched = state.get(pos)
if not matched:
scores.append(score)
score = 0

else:
score = score + 2

scores.append(score)

return scores

def longestValidParentheses(self, s: str) -> int:
scores = [0]
state = dict()
position = list()
opened = list()
closed = list()
for p, paren in enumerate(s):
if paren == "(":
opened.append(p)
position.append(p)
state[p] = False

elif paren == ")" and len(opened) > 0:
op = opened.pop()
state[op] = True

else:
scores.extend(self._score(position, state))
state = dict()
position = list()
opened = list()
closed = list()

scores.extend(self._score(position, state))
return max(scores)
Loading