GithubHelp home page GithubHelp logo

aurimas13 / solutions-to-problems Goto Github PK

View Code? Open in Web Editor NEW
85.0 7.0 29.0 4.25 MB

Solutions to coding problems of Java, Python and SQL that can occur through high-tier interviews or while implementing algorithms used here in daily jobs & preparation advices for interviews.

License: MIT License

Python 65.70% Java 34.30%
hackerrank leetcode leetcode-solutions python coding-interviews data-structures dynamic-programming interview-preparation interview-questions algorithm-challenges

solutions-to-problems's Introduction

Welcome to the Amazing World of Solutions! ๐ŸŽ‰๐ŸŽฉ๐Ÿ”ฎ

Brace yourself as we dive into the most common solutions to problems from interviews of high-tier companies.

Featuring dazzling Python, Java, SQL & Pandas Solutions to challenges on LeetCode & HackerRank.


python java sql lastcommit stars twitter twitter


๐Ÿ“ข Roll up, roll up! Welcome to the grand repository of brilliant code solutions. Constantly updated with enchanting Python, Java, SQL or Pandas solutions to bewitching problems found at LeetCode (mostly) or HackerRank. Share the thrill as we unravel the mysteries of high-tier companies like Google, Meta, Amazon, Apple, Spotify, and more!

๐ŸŽช Behold the mesmerizing progress of the LeetCode account, sprinkled with magical blog posts providing explanations on select solutions. Gaze upon it here.

๐ŸŽก Marvel at the colorful array of LeetCode solutions in Python - here, HackerRank solutions in Python - here, LeetCode solutions in Java - here and LeetCode SQL Solutions as well as LeetCode Pandas Solutions and be fascinated by some videos of how I tackled problems here.

๐Ÿ”ฎ Each problem folder unveils the description of the problem and, sometimes, the solution and explanation. Click the name of the problem in the Problems and Solutions, Must Do Problems or Google Top to reveal its secrets.

๐ŸŽญ Currently enchanting the world with Python & a touch of Java from LeetCode with a hand in SQL and sometimes Pandas. A daily Python problem from LeetCode has been vanquished since 28th of May 2022 and a daily Java solution also is being addded since 19th May 2023.

๐ŸŽ  The magic continues with SQL & Pandas solutions of problems at HackerRank & LeetCode, coming soon to HackerRank SQL Solutions while now doing LeetCode SQL Solutions and LeetCode Pandas Solutions.

Table of Contents

Preparation for Interviews

(Back to top)

๐ŸŽฉ To prepare for a mystical journey through a MAANG interview or a MAANG-level company interview and land a job in the enchanted realm of tech giants, we highly recommend the following spells:

  1. Solve as many problems from our mesmerizing list as possible.
  2. Join the mystical Hackpack community to learn the art of sorcery from fellow wizards.
  3. Conjure your skills by solving the Top LeetCode Problems.
  4. Master the incantations of Python Skills.
  5. Test your wit with Multiple Choice Questions to prove your magical prowess. Embrace the magical journey of interview preparation, and may your code be ever enchanting! ๐ŸŒŸ๐ŸŒˆ๐Ÿ”ฎ

Problems and Solutions

There are over 500 solutions of all four languages of Python - here, Java - here Pandas - here and SQL - here with details which problems are solved at the particular folder.

Total Number

Total number of LeetCode solutions per company are shown below:*

Company Name Total Solutions
Amazon 373
Google 366
Apple 312
Facebook 318
Microsoft 290
Bloomberg 270
Adobe 264
Uber 230
Goldman Sachs 194
TikTok 145
LinkedIn 121
Airbnb 95
Tesla 84
Twitter 72
DE Shaw 41
Spotify 38
Reddit 21
Netflix 10
Others 697


* Updated daily. Details of the problems that belong to a specific company are linked to it.


Must Do Problems

(Back to top)

No. Question Solution Time Complexity Space Complexity
1 Two Sum Two Sum O(n) O(n)
2 Merge Two Sorted Lists Merge Two Sorted Lists O(n) O(n)
3 Merge k Sorted Lists Merge k Sorted Lists O(n log n) O(1)
4 Best Time to Buy and Sell Stock Best Time to Buy and Sell Stock O(n) O(1)
5 Reverse Bits Reverse bits O(1) O(1)
6 Number of 1 Bits Number of 1 bits O(log n) O(1)
7 Contains Duplicate Contains Duplicate O(n) O(n)
8 Meeting Rooms Meeting Rooms O(n log n) O(1)
9 Missing Number Missing Number O(n) O(1)
10 Counting Bits Counting bits O(n log n) O(n)
11 Merge Intervals Merge Intervals O(n log n) O(n)
12 Insert Interval Insert Interval O(n) O(n)
13 Valid Palindrome Valid Palindrome O(n) O(n)
14 Valid Parentheses Valid Parentheses O(n) O(n)
15 Climbing Stairs Climbing Stairs O(n) O(n)
16 Same Tree Same Tree O(log n) O(1)
17 Maximum Depth of Binary Tree Maximum Depth of Binary Tree O(n) O(n)
18 Linked List Cycle Linked List Cycle O(n) O(n)
19 Reverse Linked List Reverse Linked List O(n) O(n)
20 Invert Binary Tree Invert Binary Tree O(n) O(1)
21 Valid Anagram Valid Anagram O(n) O(n)
22 Lowest Common Ancestor of a Binary Search Tree Lowest Common Ancestor of a Binary Search Tree O(n) O(1)
23 Subtree of Another Tree Subtree of Another Tree O(n^2) O(n)
24 Combination Sum Combination Sum O(2^n) O(n)
25 Container With Most Water Container With Most Water O(n) O(1)
26 3Sum 3Sum O(n^2) O(n)
27 Longest Substring Without Repeating Characters Longest Substring Without Repeating Characters O(n) O(n)
28 Longest Palindromic Substring Longest Palindromic Substring O(n^2) O(1)
29 Rotate Image Rotate Image O(n^2) O(1)
30 Search in Rotated Sorted Array Search in Rotated Sorted Array O(log n) O(1)
31 Word Search Word Search O(n^2) O(n)
32 Word Break Word Break O(n^2) O(n)
33 Number of Islands Number of Islands O(n^2) O(n^2)
34 Coin Change Coin Change O(n^2) O(n)
35 Course Schedule Course Schedule O(n) O(n)
36 Decode Ways Decode Ways O(n) O(n)
37 House Robber House Robber O(n) O(1)
38 Group Anagrams Group Anagrams O(n) O(n)
39 Find the Duplicate Number Find the Duplicate Number O(n) O(n)
40 Find Minimum in Rotated Sorted Array Find Minimum in Rotated Sorted Array O(log n) O(1)
41 Sum of Two Integers Sum of Two Integers O(1) O(1)
42 Maximum Subarray Maximum Subarray O(n) O(n)
43 Set Matrix Zeroes Set Matrix Zeroes O(n^2) O(n)
44 Maximum Product Subarray Maximum Product Subarray O(n) O(n)
45 Longest Consecutive Sequence Longest Consecutive Sequence O(n log n) O(1)
46 Palindromic Substrings Palindromic Substrings O(n^2) O(n^2)
47 Spiral Matrix Spiral Matrix O(n^2) O(n^2)
48 Product of Array Except Self Product of Array Except Self O(n) O(n)
49 Graph Valid Tree Graph Valid Tree O(n) O(n)
50 Unique Paths Unique Paths O(n^2) O(n^2)
51 Minimum Window Substring Minimum Window Substring O(n) O(n)
52 Remove Nth Node From End of List Remove Nth Node From End of List O(n) O(1)
53 Jump Game Jump Game O(n^2) O(1)
54 Reorder List Reorder List O(n) O(n)
55 Validate Binary Search Tree Validate Binary Search Tree O(n) O(n)
56 Binary Tree Level Order Traversal Binary Tree Level Order Traversal O(n) O(n)
57 Construct Binary Tree from Preorder and Inorder Traversal Construct Binary Tree from Preorder and Inorder Traversal O(n) O(n)
58 Clone Graph Clone Graph O(n) O(n)
59 Kth Smallest Element in a BST Kth Smallest Element in a BST O(n) O(n)
60 Encode and Decode Strings Encode and Decode Strings O(n) O(n)
61 Design Add and Search Words Data Structure Design Add and Search Words Data Structure O(n) O(n)
62 Serialize and Deserialize BST Serialize and Deserialize BST O(n) O(n)
63 Longest Common Subsequence Longest Common Subsequence O(n) O(n)
64 Longest Increasing Subsequence Longest Increasing Subsequence O(n^2) O(n)
65 Pacific Atlantic Water Flow Pacific Atlantic Water Flow O(n^2) O(n^2)
66 Top K Frequent Elements Top K Frequent Elements O(n) O(n)
67 Longest Repeating Character Replacement Longest Repeating Character Replacement O(n) O(1)
68 Non-overlapping Intervals Non-overlapping intervals O(n) O(n)
69 Number of Connected Components in an Undirected Graph Number of Connected Components in an Undirected Graph O(log n) O(n)
70 Alien Dictionary Alien Dictionary O(n log n) O(n)
71 Lowest Common Ancestor of a Binary Tree Lowest Common Ancestor of a Binary Tree O(n) O(1)
72 Implement Trie (Prefix Tree) Implement Trie (Prefix Tree) O(n) O(n)
73 House Robber II House Robber II O(n) O(n)
74 Meeting Rooms II Meeting Rooms II O(n log n) O(n)
75 Word Search II Word Search II O(n^2) O(n^2)
76 Binary Tree Maximum Path Sum Binary Tree Maximum Path Sum O(n) O(n)
77 Find Median from Data Stream Find Median from Data Stream O(log n) O(n)

Google Top

(Back to top)

No. Question Solutiion Time Complexity Space Complexity
1 Two Sum Two Sum O(n) O(n)
2 Maximal Rectangle Maximal Rectangle O(n) O(n)
3 Insert Interval Insert Interval O(n) O(n)
4 X of a Kind in a Deck of Cards X of a Kind in a Deck of Cards O(n log n) O(n)
5 Maximal Square Maximal Square O(n^2) O(n^2)
6 Bulls and Cows Bulls and Cows O(n) O(1)
7 Evaluate Division Evaluate Division O(n^2) O(n^2)
8 Decode String Decode String O(n) O(n)
9 Longest String Chain Longest String Chain O(n log n) O(n)
10 Validate Stack Sequences Validate Stack Sequences O(n) O(n)
11 Minimum Window Substring Minimum Window Substring O(n) O(n)
12 The Skyline Problem The Skyline Problem O(n log n) O(n)
13 Longest Increasing Path in a Matrix Longest Increasing Path in a Matrix O(n^2) O(n^2)
14 Find Median from Data Stream Find Median from Data Stream O(log n) O(n)
15 Count of Smaller Numbers After Self Count of Smaller Numbers After Self O(n log n) O(n)
16 Network Delay Time Network Delay Time O(n log n) O(n)
17 Subarray Sum Equals K Subarray Sum Equals K O(n) O(n)
18 Max Sum of Rectangle No Larger Than K Max Sum of Rectangle No Larger Than K n log(n) O(n)
19 Split Array into Consecutive Subsequences Split Array into Consecutive Subsequences O(n) O(n)
20 Split Array Largest Sum Split Array Largest Sum O(log n O(1)
21 Minimum Domino Rotations For Equal Row Minimum Domino Rotations For Equal Row O(n) O(1)
22 Random Pick with Weight Random Pick with Weight O(log n) O(n)

License

LICENSE

solutions-to-problems's People

Contributors

aurimas13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

solutions-to-problems's Issues

'Solution' object has no attribute 'maximumInvitations'

------------------------------ Maximum Gap/maximum.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Maximum Gap/maximum.py", line 44, in
Solve = Instant.maximumInvitations(grid = [[1,1,1], [1,0,1], [0,0,1]])
AttributeError: 'Solution' object has no attribute 'maximumInvitations'

AssertionError

------------------------------ Jump Game II/jump.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Jump Game II/jump.py", line 36, in
test_solution()
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Jump Game II/jump.py", line 29, in test_solution
assert s.jump([5, 4, 3, 2, 1, 1, 1]) == 1
AssertionError

'Solution' object has no attribute 'thirdMax'

------------------------------ Time Needed to Inform All Employees/time.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Time Needed to Inform All Employees/time.py", line 23, in
Solve = Instant.thirdMax(n = 1, headID = 0, manager = [-1], informTime = [0])
AttributeError: 'Solution' object has no attribute 'thirdMax'

'list' object has no attribute 'val'

------------------------------ Add Two Numbers/add.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Add Two Numbers/add.py", line 29, in
Solve = Instant.addTwoNumbers([2,4,3], [5,6,4]) # "aabb" -> ['baab', 'abba']
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Add Two Numbers/add.py", line 9, in addTwoNumbers
root = ListNode((l1.val + l2.val) % 10)
AttributeError: 'list' object has no attribute 'val'

'Solution' object has no attribute 'haveConflict'

------------------------------ Different Ways to Add Parentheses/Determine if Two Events Have Conflict/different.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Different Ways to Add Parentheses/Determine if Two Events Have Conflict/different.py", line 31, in
Solve = Sol.haveConflict(expression = "2-1-1")
AttributeError: 'Solution' object has no attribute 'haveConflict'

zigzagLevelOrder() missing 1 required positional argument: 'root'

------------------------------ Binary Tree Zigzag Level Order Traversal/binary.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Binary Tree Zigzag Level Order Traversal/binary.py", line 41, in
print(Solution.zigzagLevelOrder(root))
TypeError: zigzagLevelOrder() missing 1 required positional argument: 'root'

'Solution' object has no attribute 'strStr'

------------------------------ Find the Minimum Number of Fibonacci Numbers Whose Sum Is K/find.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Find the Minimum Number of Fibonacci Numbers Whose Sum Is K/find.py", line 24, in
Solve = Sol.strStr(haystack = "sadbutsad", needle = "sad")
AttributeError: 'Solution' object has no attribute 'strStr'

'Solution' object has no attribute 'countNodes'

------------------------------ Count Odd Numbers in an Interval Range/count.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Count Odd Numbers in an Interval Range/count.py", line 9, in
Solve = Sol.countNodes(low = 3, high = 7)
AttributeError: 'Solution' object has no attribute 'countNodes'

AssertionError

------------------------------ Minimum Height Trees/minimum.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Minimum Height Trees/minimum.py", line 51, in
assert sol.findMinHeightTrees(n2, edges2) == [3, 4]
AssertionError

colorTheGrid() missing 1 required positional argument: 'n'

------------------------------ Painting a Grid With Three Different Colors/painting.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Painting a Grid With Three Different Colors/painting.py", line 41, in
Solve = Instant.colorTheGrid(121)
TypeError: colorTheGrid() missing 1 required positional argument: 'n'

'Solution' object has no attribute 'countPrimes'

------------------------------ Count Square Submatrices with All Ones/count.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Count Square Submatrices with All Ones/count.py", line 21, in
Solve = Sol.countPrimes(n=10)
AttributeError: 'Solution' object has no attribute 'countPrimes'

no attribute 'assign_tasks'

------------------------------ Process Tasks Using Servers/process.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Process Tasks Using Servers/process.py", line 44, in
Solve = Instant.assign_tasks(servers, tasks)
AttributeError: 'Solution' object has no attribute 'assign_tasks'

name 'null' is not defined

------------------------------ Construct Binary Tree from Preorder and Inorder Traversal/construct.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Construct Binary Tree from Preorder and Inorder Traversal/construct.py", line 32, in
assert Solution().buildTree([3,9,20,15,7], [9,3,15,20,7]) == [3,9,20,null,null,15,7]
NameError: name 'null' is not defined

'>' not supported between instances of 'list' and 'int'

------------------------------ Count Numbers with Unique Digits/count.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Count Numbers with Unique Digits/count.py", line 22, in
Solve = Sol.countNumbersWithUniqueDigits([5,2,6,1])
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Count Numbers with Unique Digits/count.py", line 6, in countNumbersWithUniqueDigits
if n > 10:
TypeError: '>' not supported between instances of 'list' and 'int'

name 'TreeNode' is not defined

------------------------------ Binary Search Tree Iterator/binary.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Binary Search Tree Iterator/binary.py", line 1, in
class BSTIterator:
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Binary Search Tree Iterator/binary.py", line 3, in BSTIterator
def init(self, root: TreeNode):
NameError: name 'TreeNode' is not defined

TypeError: distanceK() missing 1 required positional argument: 'k'

------------------------------ All Nodes Distance K in Binary Tree/nodes.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/All Nodes Distance K in Binary Tree/nodes.py", line 46, in
print(Solution.distanceK(root, target, k))
TypeError: distanceK() missing 1 required positional argument: 'k'

'Solution' object has no attribute 'findMaxConsecutiveOnes'

------------------------------ Max Area of Island/max.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Max Area of Island/max.py", line 33, in
Solve = Instant.findMaxConsecutiveOnes(grid = [[0,0,0,0,0,0,0,0]])
AttributeError: 'Solution' object has no attribute 'findMaxConsecutiveOnes'

mirrorReflection() missing 1 required positional argument: 'q'

------------------------------ Mirror Reflection/mirror.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Mirror Reflection/mirror.py", line 20, in
Solve = Instant.mirrorReflection([3, 0, 1])
TypeError: mirrorReflection() missing 1 required positional argument: 'q'

Assertion test failure

------------------------------ Battleships in a Board/battle.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Battleships in a Board/battle.py", line 32, in
assert solution.countBattleships([
AssertionError

name 'isBadVersion' is not defined

------------------------------ First Bad Version/first.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/First Bad Version/first.py", line 22, in
Solve = Sol.firstBadVersion(n = 5) # n = 5, bad = 4 -> 4
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/First Bad Version/first.py", line 8, in firstBadVersion
if isBadVersion(v):
NameError: name 'isBadVersion' is not defined

name 'lru_cache' is not defined

------------------------------ Shortest Palindrome/shortest.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Shortest Palindrome/shortest.py", line 27, in
Solve = Instant.minDistance(word1="intention", word2="execution") # word1 = "intention", word2 = "execution" -> 5
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Shortest Palindrome/shortest.py", line 4, in minDistance
@lru_cache(maxsize=None)
NameError: name 'lru_cache' is not defined

name 'null' is not defined

------------------------------ Maximum Width of Binary Tree/maximum.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Maximum Width of Binary Tree/maximum.py", line 38, in
assert Solution().widthOfBinaryTree([1,3,2,5,3,null,9]) == 4
NameError: name 'null' is not defined

Test case 2 failed: expected 8, got 7

------------------------------ Last Moment Before All Ants Fall Out of a Plank/last.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Last Moment Before All Ants Fall Out of a Plank/last.py", line 35, in
run_tests()
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Last Moment Before All Ants Fall Out of a Plank/last.py", line 30, in run_tests
assert result == expected, f"Test case {i} failed: expected {expected}, got {result}"
AssertionError: Test case 2 failed: expected 8, got 7

findCheapestPrice() got multiple values for argument 'n'

------------------------------ Cheapest Flights Within K Stops/cheapest.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Cheapest Flights Within K Stops/cheapest.py", line 23, in
Solve = Sol.findCheapestPrice(n = 4, flights = [[0,1,100],[1,2,100],[2,0,100],[1,3,600],[2,3,200]], src = 0, dst = 3, k = 1)
TypeError: findCheapestPrice() got multiple values for argument 'n'

name 'name' is not defined

------------------------------ Number of Ways of Cutting a Pizza/number.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Number of Ways of Cutting a Pizza/number.py", line 55, in
if name == "main":
NameError: name 'name' is not defined

'Solution' object has no attribute 'minKnightMoves'

------------------------------ Minimum Number of Operations to Convert Time/minimum.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Minimum Number of Operations to Convert Time/minimum.py", line 27, in
Solve = Sol.minKnightMoves(current = "02:30", correct = "04:35")
AttributeError: 'Solution' object has no attribute 'minKnightMoves'

name 'Solution' is not defined

------------------------------ Odd Even Jump/odd.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Odd Even Jump/odd.py", line 4, in
class Solution:
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Odd Even Jump/odd.py", line 49, in Solution
test_OddEvenJumps()
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Odd Even Jump/odd.py", line 35, in test_OddEvenJumps
solution = Solution()
NameError: name 'Solution' is not defined

expression cannot contain assignment

------------------------------ Split a String Into the Max Number of Unique Substrings/split.py
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Split a String Into the Max Number of Unique Substrings/split.py", line 40
Solve = Instant.maxUniqueSplit(nums = [s = "ababccc")
^
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

AssertionError

------------------------------ Gas Station/gas.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Gas Station/gas.py", line 29, in
assert solution.canCompleteCircuit([1, 4, 2], [1, 2, 4]) == -1
AssertionError

AssertionError

------------------------------ Number of Longest Increasing Subsequence/number.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Number of Longest Increasing Subsequence/number.py", line 22, in
assert Solution().findNumberOfLIS([1,2,4,3,5,4,7,2,1,2,4,3,5,4,7,2]) == 3
AssertionError

reconstructQueue() got an unexpected keyword argument 'nums'

------------------------------ Queue Reconstruction by Height/queue.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Queue Reconstruction by Height/queue.py", line 23, in
Solve = Instant.reconstructQueue(nums = [1,2,3,4])
TypeError: reconstructQueue() got an unexpected keyword argument 'nums'

'Solution' object has no attribute 'isMatch'

------------------------------ Rectangle Area/rectangle.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Rectangle Area/rectangle.py", line 24, in
Solve = Instant.isMatch(s = "ab", p = ".*")
AttributeError: 'Solution' object has no attribute 'isMatch'

arraySign() missing 1 required positional argument: 'nums'

------------------------------ Sign of the Product of an Array/sign.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Sign of the Product of an Array/sign.py", line 21, in
assert Solution.arraySign([-1,-2,-3,-4,3,2,1]) == 1, "Should be 1"
TypeError: arraySign() missing 1 required positional argument: 'nums'

name 'print_list' is not defined

------------------------------ Reorder List/reorder.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Reorder List/reorder.py", line 41, in
print_list(val)
NameError: name 'print_list' is not defined

name 'List' is not defined

------------------------------ Count Number of Distinct Integers After Reverse Operations/count.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Count Number of Distinct Integers After Reverse Operations/count.py", line 1, in
class Solution:
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Count Number of Distinct Integers After Reverse Operations/count.py", line 2, in Solution
def countDistinctIntegers(self, nums: List[int]) -> int:
NameError: name 'List' is not defined

AssertionError

------------------------------ Checking Existence of Edge Length Limited Paths/check.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Checking Existence of Edge Length Limited Paths/check.py", line 66, in
assert solution.distanceLimitedPathsExist(n3, edgeList3, queries3) == [True, True, False, True]
AssertionError

maxProfit() missing 1 required positional argument: 'prices'

------------------------------ Best Time to Buy and Sell Stock IV/best_buy_sell.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Best Time to Buy and Sell Stock IV/best_buy_sell.py", line 40, in
Solve = Sol.maxProfit([2,4,1]) # [2,4,1] -> 2
TypeError: maxProfit() missing 1 required positional argument: 'prices'

name 'List' is not defined

------------------------------ Redundant Connection/redundant.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Redundant Connection/redundant.py", line 29, in
class Solution:
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Redundant Connection/redundant.py", line 30, in Solution
def findRedundantConnection(self, edges: List[List[int]]) -> List[int]:
NameError: name 'List' is not defined

TypeError: object of type 'Solution' has no len()

------------------------------ Substring with Concatenation of All Words/substring.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Substring with Concatenation of All Words/substring.py", line 60, in
test_solution(s, words, expected)
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Substring with Concatenation of All Words/substring.py", line 53, in test_solution
result = s.findSubstring(s, words)
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Substring with Concatenation of All Words/substring.py", line 46, in findSubstring
return find_all_concatenated_words(s, words)
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Substring with Concatenation of All Words/substring.py", line 14, in find_all_concatenated_words
if len(s) < total_length:
TypeError: object of type 'Solution' has no len()

nextGreatestLetter() missing 1 required positional argument: 'target

------------------------------ Find Smallest Letter Greater Than Target/smallest_letter.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Find Smallest Letter Greater Than Target/smallest_letter.py", line 27, in
Solve = Sol.nextGreatestLetter(["c","f","j"]) # letters = ["c","f","j"], target = "a" -> "c"" | letters = ["c","f","j"], target = "d" -> "f"
TypeError: nextGreatestLetter() missing 1 required positional argument: 'target

name 'heapq' is not defined

------------------------------ Find the Kth Smallest Sum of a Matrix With Sorted Rows/find.py
Traceback (most recent call last):
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Find the Kth Smallest Sum of a Matrix With Sorted Rows/find.py", line 35, in
print(sol.kthSmallest(mat, k)) # Expected output: 7
File "/Users/hughbrown/workspace/Solutions-To-Problems/LeetCode/Python Solutions/Find the Kth Smallest Sum of a Matrix With Sorted Rows/find.py", line 13, in kthSmallest
current_sum, state = heapq.heappop(heap)
NameError: name 'heapq' is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.