DDSA Solutions

String

181 problems · 127 with full explanations

44 Easy63 Medium21 Hard
String problems range from simple character counting to complex pattern matching. Common approaches include two pointers, sliding window, prefix hashing, and the KMP algorithm. In C#, strings are immutable — use StringBuilder for efficient concatenation inside loops.

How to practice

To practice String problems effectively, start with the Easy problems listed below, trace through each solution on paper, then re-implement without looking. When you can recognise the string pattern within 30 seconds of reading a new problem, move on to Medium difficulty. Use the related topic pages and our study guide for a structured progression.

Open the full study guide →

Start here (Easy + explained)

All String problems