CommonLounge is a community of learners who learn together. Get started with the featured resources above, ask questions and discuss related stuff with everyone.
1.
discussion
I understand the problem, but I can't go ahead! (For beginners)
Ahem..
First of all we are sorry that it's too late.
Let me tell you a common problem I face in contests.
"I read the problem statement and I understand that pretty well. But either I don't know how to approach or I get stuck in fixing bugs."
Sometimes it takes more than an hour to fix the bugs and the contest ends.
This is a common scenario for beginners like me.
For a beginner normally there are 3 types of problems in a contest ( especially in onsite ones). (Maybe these are true for experts too :p)
They understands the problem but can get AC because of lack of bug-free coding skills.
They understands nothing of a problem.
They understands well and get AC for 1-3 problems.
This problem would have been a classical problem if the memory limits would not have been that tight. In the classical version we can use DP or the LCS with O(n^2) memory but this problem requires O(n) memory.
How to go about it?
I searched the solution of this problem online but found only codes and not the solution.