Ask Jeeves interview question
Description
In an interview with Ask Jeeves search engine the following problem was presented:
Given the input of a set of string values loaded from memory, perhaps from a file, for example:
- "mary, mark, simon, jack, bob, ...etc"
Write a program, in pseudo code, which accepts any input and retrieves values containing an
occurrence of each distinct character. Order is unimportant. There can be up to ~200 values.
The algorithm should focus on speed. Example inputs and resulting ouputs are:
- Input: "m" = Output: "mary, mark, simon"
- Input: "ry" = Output: "mary"
- Input: "amr" = Output: "mary, mark"
- Input: "o" = Output: "simon, bob"
Solution
Solution Algorithm only