Round 1
Questions: You are exploring an ancient tomb for treasure. You’ve found a room in the tomb which has a table. On this table, there are some letters written on stones, and there is a list of words on the wall.
To solve this puzzle you need to arrange the letters to form as many of the given words as possible. You can only use each letter once (and they cannot be reused across words), and you can only form each word once. The letters may be given in any order and not all letters need to be used.
Write a function that returns the words you should form. If there are multiple possible answers, return any valid answer.
Example:
words1 = ["list", "of", "wall", "words"] letters1 = "listofstoneletters" find_words(words1, letters1) => ['list', 'of']
Words can be returned in any order, and not all letters need to be used.
Additional inputs:
words2 = ["and", "do", "like", "for", "us", "of", "part", "can", "have", "view"] letters2 = "youcanhavepart" finder(words2, letters2) => ["can", "have", "part"] words2 = ["and", "do", "like", "for", "us", "of", "part", "can", "have", "view"] letters3 = "aaacehnoprtuvy" finder(words2, letters3) => ["can", "have", "part"] words3 = ["abc", "a", "b", "c"] letters6 = "abc" finder(words3, letters6) => ["a", "b", "c"]
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.