Facebook | Phone | Verifying an Alien Dictionary

Anonymous User
1172
Jan 16, 2020
Jan 17, 2020

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.

Comments (1)