Facebook | Phone | Transitive reduction & Factorial Trailing Zeroes
Anonymous User
2141

Question 1:
Given a directed graph remove return minimum of edges to keep all paths .

Example:

Input: [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]] 
Output: 3
Explanation: Minimum number of edges is 3 (1 2, 2 3, 3 4)

Before

After
image

Question 2:
https://leetcode.com/problems/factorial-trailing-zeroes/

The second one was very easy but for the first one I used a sort of dfs with some custom node but the interviewer doesn't seem to be so happy...

Comments (14)