Skip to main content
hardBlind 75

Alien Dictionary

Given a sorted alien dictionary, find character order Compare adjacent words to determine character precedence Example: ["wrt", "wrf"] -> 't' comes before 'f' ["er", "ett"] -> 'r' comes before 't'

Given words sorted in an alien language, figure out the alphabet order. It's a graph problem in disguise: each pair of adjacent words gives you ordering constraints, and you need to find an order that satisfies all of them. The gotcha is detecting when no valid order exists—cycles in your constraint graph mean the input is invalid.

Arrays & HashingStringGraphsBFS / DFS

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Alien Dictionary - Build Character Graphhard
2Part 2

Each locked part opens in the editor once the part before it passes.

Based onLeetCode