Facebook | Phone | Verifying an Alien Dictionary
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-01-16Added By Anonymous
Source: Link
Company: Meta (Facebook)
Role: e3, e4
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
https://leetcode.com/problems/verifying-an-alien-dictionary/
Input :
words : ["apps","cat","tags","bag"]
alphabets : ['t', 'g', 'b', 'd', 'a', 'c', 'p' ,'s'];
output: false (since "bag" should appear before "apps", since 'b' come before 'a' in alphabets array.
check if the words array is sorted as per the alphabets order . return true or false.