Sort 66 Discussions, By:
Please Login in order to post a comment
What's the point of embedding the LCS problem in this dynamic-cast mystery problem?
All most all code examples in hackerrank C++ are
These do become important when you do real world programming for production quality code.
Note: This is a very bad code example!
The code is producing memory leaks!!! none of the cast spells is ever deallocated in main. Do not do that! if you need a polymorphic return use std::shared_ptr and make_shared or unique_ptr and make_unique.
The great problem with this test is that the english words used are trick and cause difficults to non-english native speakers to understand.
I tried this out yesterday and can't seem to grok the criteria for:
"If it is a generic spell, find a subsequence of letters that are contained in both the spell name and your spell journal. Among all such subsequences, find and print the length of the longest one on a new line."
They're definitely not continued subsequences, and I thought it would be shared letters in order but that's not right, either.
Can anyone specify the constraint in a clear manner?