Stuck in this dp problem ! pls help

Правка en1, от kkumar123, 2020-10-30 22:51:27

Question link

QUESTION - Given two strings, and , find and print the total number of ways to insert a character at any position in string such that the length of the Longest Common Subsequence of characters in the two strings increases by one.

n^2 approach acceptable

my approach to this question

Please , can anybody help me what's wrong in my code. I have commented it so that it is easy to understand. I think there is some recounting in my approach.

Теги #dynamic programing

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский kkumar123 2020-10-30 22:51:27 607 Initial revision (published)