Skip to content

Commit

Permalink
Add a title
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyannn committed Jan 20, 2024
1 parent 299f1fc commit cb16315
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lc_0684_redundant_connection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# https://leetcode.com/problems/redundant-connection/solutions/4598163/strip-out-the-leaves-and-the-cycle-is-revealed
"""
"""Strip out the leaves and the cycle is revealed.
We apply topological sort to remove everything except the cycle.
Time complexity: O(n) (we perform constant operations per vertex), assuming accessing the dictionary is constant.
Space complexity: O(n) (we store constant additional info per node)
Expand Down

0 comments on commit cb16315

Please sign in to comment.