Skip to content

nicolasmartinrojo/alien_dictionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alien_dictionary

Given a sorted dictionary (array of words) of an alien language, find order of characters in the language.

Input: words[] = {"baa", "abcd", "abca", "cab", "cad"}
Output: Order of characters is 'b', 'd', 'a', 'c'

Note that words are sorted and in the given language "baa" comes before "abcd", therefore 'b' is before 'a' in output. Similarly we can find other orders.

Input: words[] = {"caa", "aaa", "aab"}
Output: Order of characters is 'c', 'a', 'b'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published