public class Solution { public bool IsAlienSorted(string[] words, string order) { string HumanDic = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < words.Length; i++) { var AlienWord = words[i]; var HumanWord = ""; for (int j = 0; j < AlienWord.Length; j++) { var ch = AlienWord[j]; var position = order.IndexOf(ch); var realch = HumanDic[position]; HumanWord += realch.ToString(); } words[i] = HumanWord; } var OrderedWords = words.OrderBy(x => x).ToArray(); for (int i = 0; i < words.Length; i++) { if (words[i] != OrderedWords[i]) { return false; } } return true; } }