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.
defabbreviation(a,b):# Write your code heredp=[[Falsefor_inrange(len(b)+1)]for_inrange(len(a)+1)]dp[0][0]=Trueforiinrange(len(a)):forjinrange(len(b)+1):ifdp[i][j]:ifj<len(b)anda[i].upper()==b[j]:dp[i+1][j+1]=Trueifa[i].islower():dp[i+1][j]=Truereturn'YES'ifdp[len(a)][len(b)]else'NO'
Abbreviation
You are viewing a single comment's thread. Return to all comments →
My Code