Given a list of letters, return a valid dictionary word that can be made with those letters. As a much tougher bonus, return the longest possible dictionary word that you can make with those letters.
Given a list of letters, return a valid dictionary word that can be made with those letters. As a much tougher bonus, return the longest possible dictionary word that you can make with those letters.
Permalink: http://problemotd.com/problem/alphabet-soup/
Content curated by @MaxBurstein
Comments:
Nick Krichevsky - 10 years, 5 months ago
Are we allowed to use each letter more than once? For example if the letters given are a and b, would the word 'ba' be the only valid response? Or would ['aa', 'aba', 'abba', 'ba', 'baa', 'baba'] all be valid responses?
reply permalink
Max Burstein - 10 years, 5 months ago
Each letter only once. So with a and b you could just return a.
reply permalink
Nick Krichevsky - 10 years, 5 months ago
Done.
reply permalink