News for hackers. Stuff that matters.
Re:On a Great Interview Question by behdad on Wednesday April 12, 2023 @07:28PM (#35548528)
Consider the string "thereis", and the dictionary {"there", "is"}. The greedy algorithm fails.
Re:On a Great Interview Question by behdad on Wednesday April 12, 2023 @11:38PM (#35550629)
My bad. The dictionary should be {"the", "there", "is"}.
Re:On a Great Interview Question by whiddershins on Wednesday April 12, 2023 @11:58PM (#35550756)
I am now getting that I didn’t understand what you meant by greedy.
Re:On a Great Interview Question by ttoinou on Thursday April 13, 2023 @06:35AM (#35553426)
Oh yeah makes sense, if we don't do that the greedy way we could simply continue the search if it hasn't been found. That's what I would have done