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.
This challenge is very misleading. The most difficult portion is not the part about inheritance; that's an afterthought. Instead, the most difficult portion is about subsequences (not even contiguous subsequences), making it way more of an algorithms problem. It took me a long time to think of a solution.
Hint for those other readers: The best you can do it O(n*m). Consider "the longest subsequence you could find" for a given (contiguous) substring of the scrollname and a given (contiguous) substring of the journal.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Magic Spells
You are viewing a single comment's thread. Return to all comments →
This challenge is very misleading. The most difficult portion is not the part about inheritance; that's an afterthought. Instead, the most difficult portion is about subsequences (not even contiguous subsequences), making it way more of an algorithms problem. It took me a long time to think of a solution.
Hint for those other readers: The best you can do it O(n*m). Consider "the longest subsequence you could find" for a given (contiguous) substring of the scrollname and a given (contiguous) substring of the journal.