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.
# First change your arr declartionarr=[[0for_inrange(len(str1))]for_inrange(len(str2))]# and change this inside the loopifi==0:ifstr2[i]==str1[j]:arr[i][j]=1else:arr[i][j]=a[i][j-1]elseifj==0:ifstr2[i]==str1[j]:arr[i][j]=1else:arr[i][j]=a[i-1][j]
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Common Child
You are viewing a single comment's thread. Return to all comments →