Facebook | Phone Screen | Redundant Paths & Next Permutation
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2019-10-01Added By Anonymous
Source: Link
Company: Meta (Facebook)
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
Question 1:
Given a list of directory info, return all paths which are not redundant. A redundant path is one with the root already on the list.
Ex: Input: ["/a/b/c","/a/b","/d/e","/d"]
Output: ["/a/b" , "/d"]
Similar to: https://leetcode.com/problems/find-duplicate-file-in-system/
Question 2:
Given a number find the next number made out of a permutation of every digit in it.
Similar to: https://leetcode.com/problems/next-permutation/