We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defappendAndDelete(s,t,k):# Write your code hereiflen(s)+len(t)<=k:return'Yes'i=0whilei<min(len(s),len(t))ands[i]==t[i]:i+=1root_index=idelta=len(s)-root_indexchars_to_add=len(t)-root_indexremaining_ops=k-(delta+chars_to_add)ifremaining_ops>=0andremaining_ops%2==0:return'Yes'else:return'No'
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Append and Delete
You are viewing a single comment's thread. Return to all comments →
python: