Loser_'s blog

By Loser_, history, 3 years ago, In English

Need help with this digit dp problem Almost Everywhere Zero from Atcoder. Here,I increase the $$$cnt$$$ value if the $$$i$$$ th digit is non zero.Base case is if cnt==k return 1 or 0 otherwise.My submission works for smaller values but fails larger inputs or maybe I am missing some cases.I also see others solutions but couldn't find one using reccursion in my approach. Need help here. Thank you

My submission

  • Vote: I like it
  • -1
  • Vote: I do not like it