Converting one string to other using append and delete last operations | GeeksforGeeks

preview_player
Показать описание

This video is contributed by Ishmeet Kaur.

Please Like, Comment and Share the Video among your friends.

Install our Android App:

If you wish, translate into local language and help us reach millions of other geeks:

Follow us on Facebook:

And Twitter:

Also, Subscribe if you haven't already! :)
Рекомендации по теме
Комментарии
Автор

There needs to be just one more condition in case A i.e. For example, if str1=abcdefgh and str2=abcdpqrs, and k=6, then commonlen=4 and len of str1 and str2 are both 8. So it gives (6-8-8+2*4)= -2 and satisfies true condition but should be false.

ayushsinha
Автор

in the second if statement the expression

must be positive
if it is negative then string conversion is not possible
so condition should include

&&

RoronoaZoro_ViceCapt_Sunny
Автор

Why are we checking the remaining length to be even?
Can anyone explain.
Thanks in advance!

samyakjain
Автор

it is wrong the second if statement should be greater or equal than zero and divide by two

rahmatullokholov