Given the sequence of symbols A (contains ~10,000 symbols) and sequence of blocks B (contains ~3,000 blocks, ~30 symbols inside each block) I need to exclude some blocks from sequence B so that symbols inside sum of blocks from B will be equal to A. Blocks cannot be modified or replaced, they have fixed position in sequence.

[![Sequences example][1]][1]

I'm looking for some computation efficient method to solve this problem as Levenshtein distance looks too expensive for this task.


  [1]: https://i.sstatic.net/zcDBi.png