Skip to content

solves Reorder Routes to Make All Paths Lead to the City Zero (#1466) in python #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
added Links + Time & Space Complexity
  • Loading branch information
sumanth-botlagunta committed Mar 22, 2023
commit 98fc01f2c1b55b2c2e9bee58657f6214994e2945
4 changes: 4 additions & 0 deletions python/minimum_score_of_a_path_between_two_cities.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# https://leetcode.com/problems/minimum-score-of-a-path-between-two-cities/
# T: O(N + M) where N is the number of nodes and M is the number of edges
# S: O(N + M) where N is the number of nodes and M is the number of edges

from collections import deque

class Solution:
Expand Down
4 changes: 4 additions & 0 deletions python/number_of_zero_filled_subarrays.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# https://leetcode.com/problems/number-of-zero-filled-subarrays/
# T: O(N) where N is the length of nums
# S: O(1)

class Solution:
def zeroFilledSubarray(self, nums) -> int:
count = 0
Expand Down
4 changes: 4 additions & 0 deletions python/the_skyline_problem.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# https://leetcode.com/problems/the-skyline-problem/
# T: O(NlogN) where N is the number of buildings
# S: O(N) where N is the number of buildings

import bisect

class Solution:
Expand Down
4 changes: 4 additions & 0 deletions python/trie.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# https://leetcode.com/problems/implement-trie-prefix-tree/
# T: O(N) where N is the length of the word
# S: O(MN) where M is the number of words, N is the maximum length of the word

class TrieNode:
def __init__(self):
self.children = {}
Expand Down