Microsoft Onsite Question
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2023-09-20Added By Anonymous
Source: Link
I got the following question in my onsite interview with Microsoft:
Given a matrix of 2 by N of integers, select one integer from each column so that they are distinct.
I could only think and code up a backtracking based solution which had exponential time complexity and O(N) space complexity. What's the most optimal solution in terms of time complexity for this?
Thanks in advance!