Please turn JavaScript on
NamasteDev Blogs icon

NamasteDev Blogs

Get updates from NamasteDev Blogs via email, on your phone or read them on follow.it on your own custom news page.

You can filter the news from NamasteDev Blogs that get delivered to you using tags or topics or you can opt for all of them. Unsubscription is also very simple.

See the latest news from NamasteDev Blogs below.

Site title: NamasteDev

Is this your feed? Claim it!

Publisher:  Unclaimed!
Message frequency:  4.13 / day

Message History

Rabin Karp

The Rabin–Karp algorithm is a string-searching algorithm used to find a pattern inside a larger text. It’s especially useful when you need to search for multiple patterns or do repeated searches efficiently.

It uses rolling hashing.

text: a b c d b a c d



Read full story
Problem Statement:

Given two strings a and b, return the minimum number of times you should repeat string a so that string b is a substring of it. If it is impossible for b to be a substring of a after repeating it, return -1.

Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times...


Read full story
Problem Statement:

Given two strings a and b, return the minimum number of times you should repeat string a so that string b is a substring of it. If it is impossible for b to be a substring of a after repeating it, return -1.

Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times...


Read full story