Facebook | Phone | Remove Nth Node & Shortest Distance from All Buildings
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-04-04Added By Anonymous
Source: Link
Company: Meta (Facebook)
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
Question 1:
Given a singly linked list. Remove node at ith index.
https://leetcode.com/problems/remove-nth-node-from-end-of-list/
Question 2:
Variation of https://leetcode.com/problems/shortest-distance-from-all-buildings/ (premium)
Given a NxN matrix of integers as follows:
1 - space (can dig)
2 - house (cannot dig)
3 - obstacle (cannot dig)
Dig a single well so that distance to each house from the well is minimal