Skip to main content

Strings

Concept of String#

The concept of string is very similar to an array of characters that will make your life much easier. Familiarise with strings and the important STL utilities as much as possible, you will be needing them whenever you are dealing with strings. Understand clearly the difference between subarray, substring, subsequence and subset.

Tips

The following STL utilities for strings in C++ is a must know : length(), push_back(), pop_back(), begin(), end(), substr(), reverse().

Pattern Matching : KMP Algorithm#

One of the most crucial algorithms to learn for strings. There are a few other interesting data structures for strings which you will learn about later. KMP is a well known string pattern matching algorithm that will help you avoid TLE. Shared here are some of the best resources to learn about it thoroughly so don’t miss out on this opportunity.

Manachar’s Algorithm#

Questions#