You are not logged in. Please login at to post your questions!


Typical sting matching problem with rabin karp

This is a problem from codeforces round 344 div2:

Basically it asks to find the number of occurrences of string S in string T but the strings are given in following format: One block may be described as a pair (li, ci), where li is the length of the i-th block and ci is the corresponding letter. Ex:aabbc will be represented as 2-a 2-b 1-c The total no. of blocks are  ≤ 200 000 and li (as described above) is <=1000000.

Can anyone give me the idea to solve it using Rabin Karp algorithm?

asked 27 Apr '16, 15:42

ishan_nitj's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 27 Apr '16, 15:42

question was seen: 1,114 times

last updated: 27 Apr '16, 15:42