Skip to content

String problems,
and the tell.

The input is text and the answer is a substring, a count of characters, or a rearrangement. 442 problems in the catalogue carry this tag, from first-week easy to interview hard.

Free to start. Running and submitting a solution never costs credits.

How the pattern actually works.

One mechanism, and the mistake that costs people the problem.

The tell. The input is text and the answer is a substring, a count of characters, or a rearrangement.

The mechanism. A string is an array with a small alphabet, so the same walks apply, plus one more: a fixed-size count of 26 or 128 letters is often enough to replace a whole map.

What goes wrong. Treating a string as immutable when the language copies it on every concatenation. That turns an O(n) walk into O(n squared) without a single extra loop in your code.

The ones asked most often.

By how often the catalogue records them being set, not by our opinion.

  1. Valid Parenthesis StringMediumasked at 5 companies
  2. Longest Substring with At Most K Distinct CharactersMediumasked at 5 companies
  3. Number of Divisible SubstringsMediumasked at 4 companies
  4. Rank Teams by VotesMediumasked at 4 companies
  5. Remove All Adjacent Duplicates in String IIMediumasked at 4 companies
  6. Reformat DateEasyasked at 4 companies
  7. Minimum Deletions to Make Character Frequencies UniqueMediumasked at 3 companies
  8. Largest Palindromic NumberMediumasked at 3 companies
  9. Synonymous SentencesMediumasked at 3 companies
  10. Strong Password CheckerHardasked at 3 companies

Read it, watch it, then solve it.

The order that makes a pattern stick.

Everything in the app, in one place.

Practice, interviews and the tools, all free to start. Swipe to see the rest.

Free to start: 100 AI credits when you sign up and 100 every month. Start free in the app

About string problems.

Free to start, no card.

Start practising
How do I know a problem is a string problem?

The input is text and the answer is a substring, a count of characters, or a rearrangement.

How many string problems should I solve?

Enough to stop needing the hint, which is usually ten to fifteen across the levels, not the whole list. The catalogue tags 442, split roughly 49 easy, 106 medium and 45 hard in the sample we show, so work up rather than across.

What goes wrong most often in string problems?

Treating a string as immutable when the language copies it on every concatenation. That turns an O(n) walk into O(n squared) without a single extra loop in your code.

Is practising by pattern better than a problem sheet?

A sheet tells you what to solve. A pattern tells you why those problems sit together, which is the part that carries over to the problem you have not seen. That is why the app files every problem under its pattern.