AMAZON - INTERSECTION OF TWO LINKED LISTS (LeetCode) - C++ | Java | Python
This is one of Amazon's most commonly asked interview questions according to LeetCode (2019)! Intersection of Two Linked Lists coding solution. If you give me 5 minutes you'll thank me if this appears during your Amazon interview! Coding Interviews Intersection of Two Linked Lists (LeetCode) question and explanation. Telegram CHANNEL ---------------------------------------------------------------------------------------------------------------- To join the Discord channel use the following link and join the "Member" tier: https://www.technilesh.com In this Discord channel, you will be able to... 1. Ask me questions directly (as well as other members) 2. Ask about and discuss previous interview experiences 3. Find mock interview partners 4. Share helpful videos for interview preparation, and more! This question is commonly asked by the following companies: Amazon, Microsoft, Bloomberg, Oracle, Yahoo, and ByteDance. Link to problem: https://leetcode.com/problems/interse... Intuition behind solution: Throw all nodes from one list in a hash set. Walk through the other list checking at each node if the current node exists in our hash set. If it does, return that node, if not, continue to the next node. If you've exhausted the entire list, return null as there is no intersection between the two lists.