SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
45 stars 132 forks source link

Longest Commom subsequence #315

Closed PrakharRathore123 closed 3 years ago

PrakharRathore123 commented 3 years ago

Issue Id you have worked upon -

305

Briefly explain your program logic -

1)Function to calculate the LIS 2)If length of s1 or s2 is zero then return zero 3)If value is already calculated then return that 4)If last element is equal then add 1 in diagonal element 5)Else Calculate max from (i-1,y) and (i,y-1) of 2d array

Screenshots(Attach 2 screenshots of your own input and output) -

Attach here LCSA LCSB


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -

PrakharRathore123 commented 3 years ago

@SarthakKeshari Kindly acknowledge that.