We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- No Prefix Set
- Discussions
No Prefix Set
No Prefix Set
Sort by
recency
|
194 Discussions
|
Please Login in order to post a comment
don't forget that "a" is also a prefix of itself.
So how come in the example: aab aac aacghgh aabghgh is BAD SET ---> aacghgh
But in the test: aa a is Bad SET ---> a
So shouldn't the first example have been aab? Ugh. At least got some coding practice to what I thought the definition to be. Not satsifyingly passing their test cases ha.
This question answer relies on the order which is not precised. So tit cant be answered without guessing. Also its marked as 'advanced' while is pretty trivial
This is a terribly written question. In any real interview, you would be expected to ask clarifying questions, such as: 1. Do you want me to print the first string that has a prefix among the earlier strings in the array, or the first string that is a prefix of another string in the array? 2. If a string encountered later in the array is the prefix of a string encountered earlier in the array, which should be printed? 3. What should you print if there is only one element in the array? This question, as posed, relies on you exercising an essential skill (seeking clarification for unclear requirements) that is impossible to exercise in the format given.
why does test 1 have the followind outcome
BAD SET d
d isn't prefixed... and the string on the outcome should be the one with the prefix in it... i don't know what am i missing here