Leetcode - Intersection of Two Linked Lists (Python)

preview_player
Показать описание
March 2021 Leetcode Challenge
Leetcode - Intersection of Two Linked Lists #160
Difficulty: Easy
Рекомендации по теме
Комментарии
Автор

This solution made so much sense, thank you!

anandshweta
Автор

I got the same solution with the O(1) space solution. Pretty proud of myself with that one.

simonhuang
Автор

Great explanation Timothy! It was really easy to understand both of your solutions. Thanks!

ashish_us
Автор

excellent explanation! I found this problem in CTCI

rahuldas
Автор

In the first example, both lists have 1 before 8 so I think we will get 1 as the result instead of 8 since we return the first one that we've seen in the visited list. I am so confused...

jeremyliang
Автор

In case of no intersection of LLs what will be returning in this function
Could you please clarify my doubt

adarshkv
Автор

In the 2nd Solution, Don't you think a, b =0, 0 add up space; it wouldn't be o(1) space complexity, right?

MiravMehtaishere
Автор

In case of no intersection, the while loop will run infinitely?

divyamsharma