Caesar's Legions - CodeForces

Ah ! It has been a DP Sunday. I have done a good amount of DP earlier but as far as I recall, had never gone above 2D DP problems. So, while moving ahead with my A2OJ streak, I came across D. Caesar's Legions . Before discussing…

Read more

Help Katekar - HackerEarth

So today I was solving some 2D DP problems on HackerEarth and came across this problem: https://www.hackerearth.com/practice/algorithms/dynamic-programming/2-dimensional/practice-problems/algorithm/largest-subsequence-c554fb8c/description/ . I must say that the problem description was very vague and it took time for me to understand the requirements. Adding to it, the editorial provided no explanation. So,…

Read more

Wildcard Matching

The solution is as given at http://yucoding.blogspot.com/2013/02/leetcode-question-123-wildcard-matching.html . In the below implementation, I have tried to use variables that are self explanatory in what they are doing. I guess this shall help remove any doubts.I had seen one doubt regarding the use of variable “match” at https://leetcode.com/problems/wildcard-matching/discuss/17810/Linear-runtime-and-constant-space-solution . In…

Read more