Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Alien Dictionary

Words are sorted lexicographically according to the rules of an unknown alien alphabet. Given the sorted words, print the order of the letters. If several orders are valid print the lexicographically smallest one. Print an empty line if the ordering is contradictory.

Constraints

1 <= n <= 100 1 <= len(word) <= 100 Lowercase letters

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.