Help needed in digit dp problem from today's leetcode contest.

Revision en4, by Mikemirzyanov1, 2020-04-12 11:46:24

Problem -> Problem

I am trying something similar to digit dp where we need to find the number of numbers in the range a to b satisfying some property, just in this case we have strings.

My helper function is actually calculating the number of good strings which are lexicographically less than or equal s and do not contain the substring evil.

Then I simply subtract the answer for two cases.

Please help me it's almost two weeks

Spoiler

This solution only passes 15 test cases. Help me please.

Tags leetcode, digitdp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Mikemirzyanov1 2020-04-12 11:46:24 47
en3 English Mikemirzyanov1 2020-03-31 12:02:37 18 Tiny change: 't cases.\n\nSomeone please guide.\n\n' -> 't cases.\nHelp me please.\n\n'
en2 English Mikemirzyanov1 2020-03-29 16:14:55 11 Tiny change: 'less than **s** and' -> 'less than or equal **s** and'
en1 English Mikemirzyanov1 2020-03-29 15:09:58 2369 Initial revision (published)