kkumar123's blog

By kkumar123, history, 4 weeks ago, In English

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.

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