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
47 stars 132 forks source link

Number of operations to convert str1 to str2 #380

Closed PrakharRathore123 closed 2 years ago

PrakharRathore123 commented 2 years ago

Issue Id you have worked upon -

375

Briefly explain your program logic -

1)Function to Calculate the minimum of three number 2)If length of string1 is zero then return length of string2 3)If length of string2 is zero then return length of string1 4)If last char of both string is same the return diagonal element 5)Else return min of ((x-1,y-1),(x,y-1),(x-1,y)) +1

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

Attach here editdistancea EDITDIATANCEB


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 2 years ago

@SarthakKeshari Kindly acknowledge this.