3 ms·
The most difficult part was figuring out unspecified things in the problems. Generally I had to use my intuition about "otherwise this would be either impossib
by amalcon 15y ago
The most difficult part was figuring out unspecified things in the problems. Generally I had to use my intuition about "otherwise this would be either impossible or too easy" to get the right answer.
The first problem should be more explicit about the nature of the difference: a "typo" or non-shared could reasonably be an omission of a character, which would mean that the position of the unknown character does not matter. This weaker problem has more than one correct answer for the given input data. Better to call it a "corrupted byte" or somesuch.
It should be explicitly stated that the tree is balanced in the second problem. It should also state that each node contains exactly one character or that all nodes have nonempty payload (you can figure out either of those pieces of information from the other one).
The third problem should specify that it's looking for a strict partition. Contiguous is not a strong enough requirement. As written, I can have as many "contiguous subsequences" of zero elements as I want located anywhere in the string.
I particularly like the third as a teaching problem, and I might have to use it sometime. It's pretty simple, not overly reliant on programming concepts, and the "clever" solution is both faster and easier to implement than the brute-force try-everything solution.
- ithayer 15y agoVery good points. The computer screen wasn't that large so I tried to keep the descriptions short. :)
- ibdknox 15y agoGiven that the point of this is to have fun and also tease out people worth hiring, having ambiguity in the problems is a good thing I think. Rarely is a real technical problem so clearly and obviously defined. So requiring a bit of thought and intuition might prove to be a good filter :)