Skip to content

Instantly share code, notes, and snippets.

@remilapeyre
Last active March 27, 2025 13:12
Show Gist options
  • Select an option

  • Save remilapeyre/e648dffd8d3f8e38484d9b5b4621bdd0 to your computer and use it in GitHub Desktop.

Select an option

Save remilapeyre/e648dffd8d3f8e38484d9b5b4621bdd0 to your computer and use it in GitHub Desktop.
# Write a function findWord that takes a list of letter combinaisons in input, and returns the
# word issued from the combinaisons. There is always a unique solution.
# assert findWord(["P>E", "E>R", "R>U"]) == "PERU"
# assert findWord(["I>N", "A>I", "P>A", "S>P"]) == "SPAIN"
# assert findWord(["U>N", "G>A", "R>Y", "H>U", "N>G", "A>R"]) == "HUNGARY"
# assert findWord(["I>F", "W>I", "S>W", "F>T"]) == "SWIFT"
# assert findWord(["R>T", "A>L", "P>O", "O>R", "G>A", "T>U", "U>G"]) == "PORTUGAL"
# assert findWord(["W>I", "R>L", "T>Z", "Z>E", "S>W", "E>R", "L>A", "A>N", "N>D", "I>T"]) == "SWITZERLAND"
# assert findWord(["O>K"]) == "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment