Блог пользователя __Noice__

Автор __Noice__, история, 14 месяцев назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор __Noice__, история, 15 месяцев назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится