Tags

Strings

Strings

7 lessons
42 problems
12 code snippets
10 question banks
16 community items

strings

Data Structures

3 lessons

Arrays & Strings

Free
Beginner

40 min

2 prereqs

Reading `arr[1000000]` takes the same amount of time as reading `arr[0]`, because an array's contiguous memory layout lets the runtime compute the address of any element with a single multiplication. That single property is what makes **Arrays & Strings** the workhorse data structure of nearly every program you will ever write. This lesson walks through array declaration and indexing in JavaScript and Python, the cost of inserts and deletes that force shifting, slicing and subarray patterns, and the basic string operations every interview problem assumes you know. You will also see why strings behave as immutable character arrays in both languages and what that means for performance when you build strings inside a loop. In **How to Read Code (JS & Python)**, you practiced tracing programs line by line; that habit is exactly how you will reason about loop indices and slice boundaries here. **Big-O Notation (Upper Bound)** gave you the language to express scaling behavior, and arrays are where you will first see `O(1)` access sit next to `O(n)` insertion in the same data structure. Once array fundamentals are second nature, **Matrix/Grid Fundamentals** extends the same indexing intuition into two dimensions, where row and column traversal patterns power BFS, DFS, and dynamic programming on grids.

Not Started

0%

Arrays
Strings
Data Structures
Beginner
Free
Time Complexity
Fundamentals
Array Manipulation Patterns

Suffix Array / Suffix Tree

Advanced

75 min

2 prereqs

Genome alignment tools like BWA and Bowtie find a 100-character read inside a 3-billion-base human reference in milliseconds, not by scanning the genome but by querying an index built once over all of its suffixes. **Suffix Array / Suffix Tree** is the family of data structures behind that workflow, and the same machinery powers full-text search, plagiarism detection, and the BWT-based compression in bzip2. This lesson covers the suffix array (a sorted array of starting positions of every suffix), the binary-search pattern match in `O(m log n)` for a pattern of length `m`, the LCP (Longest Common Prefix) array that captures shared prefixes between adjacent sorted suffixes, and the suite of substring problems the pair solves: longest repeated substring, number of distinct substrings, and longest common substring. You will also meet the suffix tree, a compressed trie of all suffixes that pushes pattern matching down to `O(m)` independent of text length, and weigh the suffix array's smaller memory footprint against the suffix tree's faster query. In **Arrays & Strings**, sorting and binary search worked over numbers; here the same primitives extend to strings, with a comparator that compares characters position by position. **Trie (Prefix Tree)** introduced the prefix-matching tree shape, and a suffix tree is a compressed trie built from every suffix of the input. Next, the curriculum explores data structures organized around a different axis entirely: preserving every historical version of themselves through time.

Not Started

0%

Suffix Array
Suffix Tree
Strings
Sorting
Data Structures
Advanced
Premium
String Matching

Trie (Prefix Tree)

Intermediate

55 min

2 prereqs

Type the letters `a-p-p` into a search box and the autocomplete dropdown produces `apple`, `application`, `apply`, and `appoint` before you finish the next keystroke. The data structure doing that work is a **Trie** (or prefix tree), where every stored word is a path from root to a marked node and every shared prefix is shared in memory exactly once. This lesson covers the trie node layout (a `children` map plus an `isEndOfWord` flag), `insert`, `search`, and `startsWith` operations that all run in `O(m)` for a query of length `m` (independent of how many words the trie holds), and a `delete` that has to be careful not to break paths used by other words. You will also analyze the space behavior, including when a trie wins over a hash set (prefix queries, lexicographic enumeration) and when it loses (memory-tight workloads with no prefix structure to exploit). In **Hash Map (Dictionary) Basics**, you used hashing to answer 'have I seen this exact key' in `O(1)`; a trie answers a strictly richer question (any prefix lookup) by trading `O(1)` exact-match for `O(m)` traversal. **Trees: Binary Tree Fundamentals** introduced the recursive child-pointer pattern, and a trie generalizes it from two children per node to one child per alphabet symbol. With a trie in your toolkit, the curriculum moves on to graph and hash extensions that solve a different family of problems built on the same node-and-edge thinking.

Not Started

0%

Trie / Prefix Tree
Trie Operations
Trees
Data Structures
Strings
Searching
Hash Map / Dictionary
Intermediate
Premium

Algorithms

4 lessons

Iteration Patterns on Arrays/Strings

Free
Beginner

50 min

1 prereq

Look at almost any solved interview problem and you will see the same six or seven shapes of `for` loop reappearing: a single sweep that finds a max, a nested pair that compares every element to every other, a single sweep that fills a frequency table. Before you can recognize when two pointers or sliding window will help, you have to recognize these primitive shapes on sight. **Iteration Patterns on Arrays/Strings** catalogs those shapes. You will work through single-pass templates (running sum, find max/min, counting), nested-loop templates that consider all pairs in `O(n^2)` time, frequency counting with a hash map, early termination with `break`, sentinel values, and the choice between in-place modification and building a new array. Classic transformations like reverse, rotate, and partition appear as named patterns rather than puzzles solved from scratch each time. In **Arrays & Strings**, you saw that arrays give you constant-time indexed access and contiguous memory. This lesson turns that storage model into actual movement: how an index walks across an array, what it costs, and when one walk is enough. Next you will use these patterns directly in **Prefix Sum & Difference Array**, where a single preprocessing pass replaces many later range-sum loops.

Not Started

0%

Algorithms
Iteration Patterns
Arrays
Strings
Array Manipulation Patterns
Brute Force
Beginner
Free

Pattern Matching Algorithms

Advanced

55 min

1 prereq

Boyer-Moore is the algorithm `grep` actually uses, and it has a counterintuitive property: longer patterns make it _faster_, not slower, because the bad-character rule lets it skip whole chunks of the text without inspecting them. The best case is `O(n / m)`, sublinear in the text length. The same insight (start from the right, jump aggressively on mismatch) defines a different family of pattern-matching algorithms from the linear-scan family of KMP and Z. **Pattern Matching Algorithms** rounds out the string-search toolkit. You will implement Boyer-Moore with both the bad-character rule and the good-suffix rule, build a deterministic finite automaton (DFA) from a pattern and use the resulting state-transition table for `O(n)` matching after `O(m * |alphabet|)` preprocessing, and extend pattern search into two dimensions row by row. The lesson closes with a head-to-head comparison of every string-matching algorithm you have seen so far (KMP, Z, Rabin-Karp, Manacher, Aho-Corasick, Boyer-Moore, DFA), so you can pick the right tool for any matching task: long patterns, multi-pattern, streaming, or 2D. In **String Algorithms**, you mastered the failure-function family of linear-time matchers. This lesson adds the right-to-left family and the automaton-construction family. From here, **Advanced Greedy & Data Structures** turns to monotonic stacks.

Not Started

0%

Algorithms
Strings
String Matching
Patterns
Advanced
Premium
Comparison
Deep Dive

Sliding Window (Intro)

Free
Beginner

55 min

2 prereqs

To find the longest substring of `s` with no repeated characters, the brute-force approach checks every substring in `O(n^3)` time. The sliding-window solution touches each character at most twice and runs in `O(n)`: extend a right pointer until a duplicate appears, then advance a left pointer until the duplicate is gone, repeating until the right pointer falls off the end. **Sliding Window (Intro)** turns that idea into two reusable templates. The fixed-size window slides a range of length `k` across the array and updates the running sum or count by adding the new right element and removing the old left element, never recomputing from scratch. The variable-size window expands the right edge while a condition holds and shrinks the left edge to restore that condition, tracking the window's contents with a hash map or counter. You will apply both to maximum-sum subarray of size `k`, longest substring without repeating characters, minimum window substring, and longest substring with at most `k` distinct characters. In **Two Pointers (Intro)**, you used coordinated indices to walk an array linearly. **Hash Map (Dictionary) Basics** gave you the `O(1)` lookup and update that lets a window track its own contents efficiently. Sliding window combines both: two indices and one hash map. From here you turn to **Recursion Fundamentals**, which trades sequential index movement for self-similar subproblems.

Not Started

0%

Algorithms
Sliding Window
Arrays
Strings
Subarray / Substring Problems
Time Complexity
Beginner
Free

String Algorithms

Advanced

70 min

2 prereqs

Naive substring search compares the pattern against every position in the text, restarting from scratch on each mismatch, for `O(n * m)` worst-case time. KMP, by precomputing where to resume after a mismatch, never restarts. The text pointer moves forward strictly monotonically, the pattern pointer is corrected by a failure function, and the whole search runs in `O(n + m)`. That single insight defines a family of linear-time string algorithms that power editors, search engines, and bioinformatics pipelines. **String Algorithms** covers that family. KMP teaches you to build the failure function (prefix function) and use it to skip redundant comparisons. The Z algorithm offers an alternative `O(n)` framework based on the Z-array. Rabin-Karp introduces rolling hashes for multi-pattern search and is the backbone of plagiarism detection. Manacher's algorithm finds the longest palindromic substring in linear time using a clever transform with separators. Aho-Corasick generalizes KMP to multiple patterns simultaneously by adding failure links to a trie, producing a finite automaton that scans the text once. In **Arrays & Strings**, you treated strings as arrays of characters with `O(1)` indexed access. **Hash Map (Dictionary) Basics** gave you the `O(1)` lookup used by Rabin-Karp. This lesson layers algorithmic structure on top of those primitives. Next, **Pattern Matching Algorithms** extends the toolkit with Boyer-Moore, DFA-based matching, and 2D pattern search.

Not Started

0%

Algorithms
Strings
String Matching
KMP Algorithm
Rabin-Karp Algorithm
Z-Algorithm
Rolling Hash
Palindrome
Advanced
Premium

Practice Problems

42 problems

Add Binary

Free
Not Started
Easy

Given two binary strings, return their sum as a binary string.

Bit Manipulation
Strings
Mathematics
Algorithms
Beginner
Free

247

1

Is Subsequence

Free
Not Started
Easy

Determine if string s is a subsequence of string t by checking if all characters of s appear in t in the same order.

Two Pointers
Strings
Subsequence
Beginner

332

4

Isomorphic Strings

Free
Not Started
Easy

Determine if two strings are isomorphic, where each character in one string can be mapped to exactly one character in the other.

Arrays
Hash Map / Dictionary
Strings
Beginner

1.1k

21

Length of Last Word

Free
Not Started
Easy

Given a string of words separated by spaces, return the length of the last word.

Arrays
Strings
Beginner

1.1k

30

Longest Common Prefix

Free
Not Started
Easy

Find the longest common prefix string among an array of strings.

Arrays
Strings
Beginner

977

29

Ransom Note

Free
Not Started
Easy

Determine if a ransom note can be constructed from the characters available in a magazine string.

Arrays
Hash Map / Dictionary
Strings
Beginner

1.1k

31

Valid Anagram

Free
Not Started
Easy

Given two strings, determine if one is an anagram of the other by comparing character frequencies.

Arrays
Hash Map / Dictionary
Strings
Beginner

1k

27

Valid Palindrome

Free
Not Started
Easy

Determine if a string is a palindrome, considering only alphanumeric characters and ignoring cases.

Two Pointers
Strings
Palindrome
Beginner

284

5

Word Pattern

Free
Not Started
Easy

Check if a string of words follows the same pattern as a given pattern string, using a bijective character-to-word mapping.

Arrays
Hash Map / Dictionary
Strings
Beginner

240

4

Distinct Subsequences

Not Started
Hard

Given two strings s and t, return the number of distinct subsequences of s which equals t.

Dynamic Programming
Strings
Tabulation
Advanced

841

16

Minimum Window Substring

Not Started
Hard

Find the smallest substring of s that contains all characters of t, including duplicates.

Strings
Sliding Window
Hash Map / Dictionary
Frequency Count
Advanced

346

9

Regular Expression Matching

Not Started
Hard

Implement regular expression matching with support for '.' (matches any single character) and '*' (matches zero or more of the preceding element).

Dynamic Programming
Strings
Tabulation
Regular Expressions
Advanced

425

4

Substring with Concatenation of All Words

Not Started
Hard

Find all starting indices where a concatenation of all given words (each of equal length) forms a substring.

Strings
Sliding Window
Hash Map / Dictionary
Frequency Count
Advanced

455

14

Text Justification

Not Started
Hard

Given an array of words and a maximum width, format the text so that each line has exactly the specified number of characters, fully justified (left and right).

Strings
Simulation
Greedy
Advanced

798

12

Word Ladder

Not Started
Hard

Given a begin word, end word, and a dictionary, find the length of the shortest transformation sequence where each step changes exactly one letter.

Graphs
BFS
Shortest Path
Word Ladder
Strings
Advanced

1.1k

19

Word Search II

Not Started
Hard

Given a 2D board of characters and a list of words, find all words that can be formed by sequentially adjacent cells on the board, using each cell at most once per word.

Trie / Prefix Tree
Trie Operations
Backtracking
DFS
Arrays
Strings
Advanced

1.1k

38

Design Add and Search Words

Not Started
Medium

Design a data structure that supports adding words and searching for words with wildcard characters, where '.' can match any single letter.

Trie / Prefix Tree
Trie Operations
DFS
Design Patterns
Strings
Intermediate

1k

14

Decode Ways

Not Started
Medium

Given a string of digits, determine the total number of ways to decode it, where 'A' = 1, 'B' = 2, ..., 'Z' = 26.

Dynamic Programming
Tabulation
Strings
Algorithms
Intermediate

823

20

Edit Distance

Free
Not Started
Medium

Given two strings word1 and word2, return the minimum number of operations (insert, delete, or replace a character) required to convert word1 into word2.

Dynamic Programming
Tabulation
Edit Distance
Strings
Algorithms
Intermediate

472

9

Encode and Decode Strings

Not Started
Medium

Design an algorithm to encode a list of strings into a single string and decode it back, handling any character content.

Strings
String Manipulation
Arrays
Intermediate

1.1k

37

Find All Anagrams in a String

Not Started
Medium

Find all start indices where an anagram of pattern p occurs in string s.

Strings
Sliding Window
Hash Map / Dictionary
Frequency Count
Anagrams
Intermediate

1.1k

22

Group Anagrams

Free
Not Started
Medium

Group an array of strings so that anagrams appear together, using a hash map with sorted-character keys.

Arrays
Strings
Hash Map / Dictionary
Sorting
Anagrams
Intermediate

566

11

Implement Trie (Prefix Tree)

Free
Not Started
Medium

Implement a trie (prefix tree) that supports inserting words, searching for exact words, and checking if any word starts with a given prefix.

Trie / Prefix Tree
Trie Operations
Design Patterns
Strings
Intermediate

555

13

Integer to Roman

Not Started
Medium

Convert an integer to its Roman numeral representation using a greedy approach with a value-symbol mapping.

Strings
Hash Map / Dictionary
Greedy
Intermediate

572

16

Interleaving String

Not Started
Medium

Given three strings s1, s2, and s3, determine whether s3 is formed by interleaving s1 and s2 while preserving the relative order of characters from each string.

Dynamic Programming
Strings
Algorithms
Intermediate

921

10

Letter Combinations of a Phone Number

Free
Not Started
Medium

Given a string containing digits from 2-9, return all possible letter combinations that the number could represent on a phone keypad.

Strings
Backtracking
Recursion
Algorithms
Intermediate

666

21

Longest Common Subsequence

Free
Not Started
Medium

Given two strings, return the length of their longest common subsequence. A subsequence is a sequence that can be derived by deleting some (or no) characters without changing the order of the remaining characters.

Dynamic Programming
Tabulation
Longest Common Subsequence
Strings
Algorithms
Intermediate

864

21

Longest Palindromic Substring

Not Started
Medium

Given a string, return the longest substring that reads the same forwards and backwards.

Strings
Dynamic Programming
Expand Around Center
Palindrome
Algorithms
Intermediate

236

1

Longest Repeating Character Replacement

Free
Not Started
Medium

Find the length of the longest substring containing the same letter after performing at most k character replacements.

Strings
Sliding Window
Hash Map / Dictionary
Intermediate

212

5

Longest Substring Without Repeating Characters

Free
Not Started
Medium

Find the length of the longest substring without repeating characters using the sliding window technique.

Strings
Sliding Window
Hash Map / Dictionary
Intermediate

506

3

Multiply Strings

Not Started
Medium

Given two non-negative integers represented as strings, return their product as a string. You must not convert the inputs to integers directly or use any built-in BigInteger library.

Mathematics
Strings
Simulation
Algorithms
Intermediate

1k

27

Palindrome Partitioning

Not Started
Medium

Given a string, partition it such that every substring of the partition is a palindrome. Return all possible palindrome partitions.

Strings
Backtracking
Recursion
Palindrome
Dynamic Programming
Algorithms
Intermediate

734

21

Palindromic Substrings

Not Started
Medium

Given a string, return the number of substrings that are palindromes. Each unique start-end position counts as a different substring even if the characters are the same.

Strings
Dynamic Programming
Expand Around Center
Palindrome
Algorithms
Intermediate

770

19

Partition Labels

Not Started
Medium

Given a string, partition it into as many parts as possible so that each letter appears in at most one part, and return a list of the sizes of these parts.

Greedy
Strings
Hash Map / Dictionary
Algorithms
Intermediate

850

18

Permutation in String

Not Started
Medium

Given two strings, determine if one string's permutation is a substring of the other.

Strings
Sliding Window
Hash Map / Dictionary
Frequency Count
Intermediate

1.1k

37

Reverse Words in a String

Not Started
Medium

Reverse the order of words in a string, handling leading/trailing spaces and multiple spaces between words.

Strings
String Manipulation
Two Pointers
Intermediate

401

11

Roman to Integer

Not Started
Medium

Convert a Roman numeral string to an integer by mapping symbols to values and handling subtractive notation.

Strings
Hash Map / Dictionary
Intermediate

917

18

Simplify Path

Not Started
Medium

Given an absolute Unix-style file path, simplify it by resolving '.', '..', and multiple slashes to produce the canonical path.

Stack
Stack-Based Parsing
Strings
Intermediate

659

19

String to Integer (atoi)

Not Started
Medium

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. Handle leading whitespace, optional sign, digit parsing, and integer overflow/underflow.

Strings
Mathematics
State Machine
Simulation
Algorithms
Intermediate

231

7

Valid Parenthesis String

Not Started
Medium

Given a string containing '(', ')' and '*' characters, determine if the string can be valid by treating each '*' as either '(', ')', or an empty string.

Greedy
Dynamic Programming
Strings
Algorithms
Intermediate

564

9

Word Break

Free
Not Started
Medium

Given a string and a dictionary of words, determine if the string can be segmented into a space-separated sequence of dictionary words.

Dynamic Programming
Tabulation
Hash Map / Dictionary
Set
Strings
Algorithms
Intermediate

977

24

Zigzag Conversion

Not Started
Medium

Convert a string to a zigzag pattern across a given number of rows, then read it line by line.

Strings
Simulation
Intermediate

916

30

Code Snippets

12 snippets
Code Snippet

Capitalize the First Letter

Capitalising the first letter of a string is a tiny task that hides several gotchas: empty inputs, multi-word phrases, and Unicode characters whose uppercase form is more than one code unit. This snippet starts with the obvious one-liner, hardens it against `null`/`undefined`/empty strings, then upgrades to a code-point-safe variant and finally a per-word title-case helper. Drop these in for form labels, headings, and CSV column titles.

JavaScript
strings
utility
code-template

454

12

Easy
Code Snippet

Convert a String to a URL Slug

Slugifying turns human titles like `"Côte d'Ivoire, 2025!"` into URL-safe segments like `'cote-d-ivoire-2025'`. Done well, it covers Unicode normalization, accent stripping, and edge punctuation; done poorly, it ships duplicate slugs or 404s. This snippet starts with a regex-only baseline, layers in `normalize('NFD')` for diacritics, and ends with a hardened version that collapses dashes and bounds the length.

JavaScript
strings
regex
utility

626

18

Easy
Code Snippet

Truncate Text with an Ellipsis

Truncating overflowing text with `...` keeps card layouts and table cells from breaking, but the naive `slice` approach often cuts mid-word or splits a surrogate pair into garbage. This snippet covers the simple character cap, a word-boundary aware version, and a code-point-correct variant for international content. Use it for previews, tooltips, and any space-bounded label.

JavaScript
strings
utility
code-template

1.1k

12

Easy
Code Snippet

Reverse a String Safely

Reversing a string is the textbook one-liner, but the obvious version `[...str].reverse().join('')` corrupts emoji families, flag sequences, and any character with combining marks. This snippet starts with the naive UTF-16 reverse, upgrades to a code-point reverse that fixes surrogate pairs, and ends with `Intl.Segmenter` for true grapheme-cluster correctness. Pick the version that matches the worst-case input you actually expect.

JavaScript
strings
utility
js-web-apis

1.1k

5

Easy
Code Snippet

Count Words in a String

Word counting drives reading-time estimates, character-budget warnings, and SEO meta-checks. The naive `str.split(' ').length` overcounts double spaces, miscounts empty input, and ignores non-Latin scripts entirely. This snippet starts with a regex-based whitespace split, hardens it against empty and whitespace-only input, then upgrades to `Intl.Segmenter` for locale-aware counting in Chinese, Japanese, and Thai where there are no spaces.

JavaScript
strings
regex
utility

827

22

Easy
Code Snippet

Escape HTML Special Characters

Inserting user input into HTML without escaping is the canonical XSS vector. The five characters `&<>"'` cover most rendering contexts, but attribute values, URL attributes, and `<script>` blocks each have stricter rules. This snippet starts with the minimal map every JS dev should memorise, adds an attribute-safe variant that also escapes the backtick, and ends with a note on when to reach for a real sanitiser like DOMPurify (without bundling it).

JavaScript
strings
regex
utility

1k

11

Medium
Code Snippet

Tiny Template String Formatter

Sometimes you need a templating helper that does not pull in handlebars or eta, just enough to substitute `{name}` placeholders against a values object. This snippet starts with a 5-line interpolator, adds escape support so literal braces survive, and ends with a tagged-template-literal version that gives you compile-time placeholder safety. Drop it into i18n strings, log formatters, or email subject lines.

JavaScript
strings
regex
js-template-literals
code-template

428

14

Medium
Code Snippet

Strip Accents and Diacritics

Removing accents from a string is the secret behind diacritic-insensitive search, slug normalization, and sort-key generation. The canonical answer is `normalize('NFD') + replace combining marks`, which works for Latin scripts, but locale-aware comparison and case-folding need richer tools. This snippet starts with the one-liner, adds a case-folded variant for matching, and ends with `Intl.Collator` for true locale-correct comparison.

JavaScript
strings
regex
js-web-apis

858

4

Medium
Code Snippet

Trie Implementation in JavaScript

A trie (prefix tree) supports insert, exact-match search, and prefix-search in O(L) where L is the word length, regardless of how many words are stored. This makes it the right structure for autocomplete, spell-check, and IP-routing tables. This snippet covers a Map-backed trie with insert and search, the startsWith prefix scan that powers autocomplete, and a wordsWithPrefix collector that returns every match.

JavaScript
data-structures
trie
code-template
strings

769

14

Medium
Code Snippet

Format Strings with String.format

`String.format` is Java's printf-style formatter for building human-readable strings without ad-hoc concatenation. This snippet covers the common conversions (`%s`, `%d`, `%.2f`, `%n`), padding and alignment for table layouts, and locale-aware vs locale-independent formatting. Reach for `String.format` for any output that mixes types or needs precise width control.

Java
strings
string-manipulation
java-string-builder

299

8

Easy
Code Snippet

Split a String by Delimiter

C++ does not ship with a one-call `split` function, so this snippet shows three idiomatic alternatives: a `std::stringstream` plus `std::getline` walk for single-character delimiters, a `find`/`substr` loop for multi-character delimiters, and a regex-based split for full pattern flexibility. Pick stringstream for whitespace, find/substr for fixed strings, and regex only when the rules are genuinely complex.

C++
cpp-string-class
string-manipulation
strings

777

16

Medium
Code Snippet

String Tricks: Anagrams, Vowels, Masking, Extension Check, Find Duplicates, Extract Numbers

A grab-bag of small string utilities pulled from a much larger pool: inspecting strings (anagram check, find duplicate characters, distinguish literal from object), counting and scanning (vowels via regex, extract numbers, extension check), transforming (mask the middle, generate alphabet ranges), and order-aware tricks (remove adjacent duplicates, reverse only words longer than n). Each is short on its own; together they cover most of the string work that shows up in real code.

JavaScript
strings
string-manipulation
regex
loops

904

16

Medium

Question Banks

10 items
Question Bank

String Basics Quiz

Three short prompts on JavaScript string immutability, slicing, and char codes. Good warm-up before tackling sliding-window or palindrome problems.

JavaScript
strings
data-structures
quiz
fundamentals

286

2

Easy
Question Bank

String Anagram and Palindrome

Five prompts on anagram detection by frequency and palindrome checks via two pointers, with one bug hunt and one canonical implementation.

JavaScript
strings
palindrome
two-pointers
interview-prep

1k

33

Medium
Question Bank

JavaScript String Manipulation Challenges

Six small-but-tricky string problems: longest-word slicing, list extraction, manual reversal, palindrome checks, anagram detection, and capitalizing every word.

JavaScript
quiz
strings
string-manipulation
interview-prep

515

8

Medium
Question Bank

JavaScript Vowel Counting: Three Approaches Quiz

Count vowels in a string three different ways (loop + Set lookup, split + forEach, regex match) plus two companion drills on case sensitivity and big-O analysis.

JavaScript
quiz
strings
string-manipulation
interview-prep

473

7

Medium
Question Bank
Premium

JavaScript Longest and Shortest Unique Substring: Two Approaches Quiz

Two seeded approaches to find the longest and shortest unique substrings (restart-on-conflict and instrumented restart), plus two companions on a real sliding window and complexity analysis.

JavaScript
quiz
strings
sliding-window
interview-prep

417

2

Hard
Question Bank
Premium

JavaScript Character Occurrence Count: Three Approaches Quiz

Count how often each unique character from a needle string appears in a haystack, three ways (Set + per-char count, dict tally, regex match per char), plus two companions on case folding and a single-pass tally.

JavaScript
quiz
strings
hash-map
interview-prep

690

2

Hard
Question Bank
Premium

JavaScript String Duplicate Finder: Two Approaches Quiz

Tally character frequencies in a string two ways (explicit loop + counter dict and reduce one-liner), plus two companions on Unicode-aware iteration and duplicates-only filtering.

JavaScript
quiz
strings
hash-map
interview-prep

583

6

Hard
Question Bank

JavaScript String-Only Regex Match: Three Approaches Quiz

Validate that a string contains only letters and whitespace, three ways (`String.prototype.match` + literal, `RegExp.test`, including-special-chars via `\D`), plus companions on Unicode letters and inverting the rule.

JavaScript
quiz
regex
strings
js-language

510

4

Medium
Question Bank

JavaScript X and O Balance: Two Approaches Quiz

Check whether a string contains an equal count of `x` and `o` (case-insensitive), two ways (regex match-array length and filter + length), plus companions on counting any pair of characters and treating empty input.

JavaScript
quiz
strings
string-manipulation
fundamentals

636

15

Medium
Question Bank

JavaScript Square and Join Digits: Two Approaches Quiz

Two seeded ways to square each digit of an integer and concatenate the results (string split with map and join, plus a while-loop modulo extraction), with two companions on negative numbers and on returning a string.

JavaScript
quiz
math
strings
array-manipulation-patterns

489

14

Medium

Community

16 items
Problem
Medium
Free

Restore IP Addresses

Given a string of digits, return every valid IPv4 address that can be formed by inserting three dots, using bounded-depth backtracking.

backtracking
strings
recursion

278

4

4.5 (10)

May 12, 2026

by CodeSnatch

Problem
Medium
Free

Subdomain Visit Count

Aggregate visit counts across every subdomain prefix from a list of count-paired domain strings.

arrays
hash-table
strings

561

16

4.4 (10)

May 9, 2026

by @jamesmurphy

Problem
Hard
$8.99

Word Break II

Return every sentence that can be formed by space-segmenting a string into dictionary words, using memoized DFS keyed by start index.

dynamic-programming
memoization
strings
backtracking

734

12

Apr 12, 2026

by @lunamitchell

Problem
Medium
Free

Decode String

Expand a run-length-encoded string with arbitrary nesting using two parallel stacks (counts and string fragments).

stack
strings
recursion

667

15

4.6 (12)

Apr 5, 2026

by CodeSnatch

Article

Tries: The Data Structure I Keep Rediscovering

When a hash set is wrong and a prefix tree is right: autocomplete, namespace routing, and fuzzy spell-check, with the memory and concurrency traps I keep falling into.

trie
data-structures
autocomplete
strings
string-matching

881

24

4.5 (12)

Apr 4, 2026

by @tylerperry

Problem
Medium
$6.99

Reorganize String

Rearrange a string so no two adjacent characters are equal, or report that no rearrangement exists.

heap
priority-queue
greedy
strings

385

9

4.3 (9)

Mar 27, 2026

by @oliviafoster

Problem
Easy
Free

Remove Outermost Parentheses

Strip the outer parentheses of every primitive group in a balanced parenthesis string, in one pass with a depth counter.

stack
strings

715

19

Mar 24, 2026

by @carlosherrera

Problem
Easy
Free

Valid Anagram

Decide whether two strings are anagrams of each other in O(n) using a frequency map.

strings
hash-map
fundamentals

381

7

3.8 (11)

Mar 22, 2026

by @ezb1981

Problem
Easy
Free

Reverse Words in a String III

Reverse the characters of every word in a sentence while keeping the word order intact.

strings
two-pointers

765

7

4.3 (11)

Mar 5, 2026

by @meinakamura

Problem
Easy
Free

Backspace String Compare

Compare two strings after applying backspace edits, with the catch that the O(1) space version uses two pointers walking from the end.

stack
two-pointers
strings

188

5

4.5 (13)

Feb 3, 2026

by @oliviafoster

Problem
Easy
Free

Reverse String

Reverse a character array in place using two pointers, no extra buffer allowed.

strings
two-pointers
fundamentals

354

1

4.4 (9)

Jan 17, 2026

by CodeSnatch

Problem
Hard
$9.99

Expression Add Operators

Insert +, -, * between digits of a string so the resulting expression equals a target, using backtracking that handles operator precedence in O(1) per step.

backtracking
strings
math
recursion

516

13

4.3 (13)

Jan 15, 2026

by @jamesmurphy

Problem
Easy
Free

Reverse Vowels of a String

Reverse only the vowels of a string while keeping consonants and punctuation in place.

strings
two-pointers

788

5

4.3 (13)

Jan 12, 2026

by @meinakamura

Problem
Medium
Free

Min Add to Make Parentheses Valid

Count the minimum number of '(' and ')' insertions that turn a parenthesis string valid using a single-pass two-counter scan.

stack
greedy
strings

1.2k

27

4.6 (10)

Jan 3, 2026

by @kavyachakraborty

Problem
Hard
$8.99

Wildcard Matching

Match a string against a wildcard pattern with `?` (any single char) and `*` (any sequence) using O(m*n) 2D DP.

dynamic-programming
strings
two-pointers

957

24

Dec 22, 2025

by @rajreeves

Problem
Medium
Free

Minimum Genetic Mutation

Transform a gene string to a target one mutation at a time, where each intermediate must be in the bank.

graphs
bfs
strings
shortest-path

592

19

4.4 (11)

Dec 13, 2025

by @lucasmoreau