__Noice__'s blog

By __Noice__, history, 22 months ago, In English

In this problem, we'll use the term "longest common substring" loosely. It refers to substrings differing at some number or fewer characters when compared index by index. For example, 'abc' and 'adc' differ in one position, 'aab' and 'aba' differ in two.

Given two strings and an integer k , determine the length of the longest common substrings of the two strings that differ in no more than k positions.

The link to the problem is : Problem Link

I am not able to understand the solution. It would be helpful if anyone can provide a good explanation. I am able to write the brute force solution but it gives TLE.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By __Noice__, history, 23 months ago, In English

For other topics, It is easy to visualize and learn the algorithms but i am not able to grasp how to solve questions with dynamic programming. I have tried solving problems but it doesn't seem to help as i am not able to get to answer without the help of editorial. Any help would be appreciated, I want help so that atleast i am able to answer decent amount of questions till 2000 level on codeforces on dp.

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it