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.
Abbreviation
Abbreviation
Sort by
recency
|
607 Discussions
|
Please Login in order to post a comment
I've passed, so this is a moot point, but doesn't the problem statement say you can "delete all of the remaining lowercase letters in a"? This implies that if you start deleting, you have to keep deleting: "all", not "some". Yet this test case does not fail as it should:
{"abCd", "Cd", false},
String B contains only capital letters, your suggested case is outside of the given problem domain.
Anyone have a non-code description of how to do this ? Nothing I've tried has worked.
This is a hard problem for sure. My head hurts: I will go to bed.
Python 3 solution
dp[i][0] may not be YES because you may have captial letters that can't be discarded
Its difficult
tricky question. the naive dynamic programming 2D matrix method takes O(a.size()^2 * b.size()), which will likely give time out, but with modification can do it in O(a.size() * b.size()) time