String Matching Problems
Master string matching problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 19 problems in this category.
Total Problems: 19
Easy: 9
Medium: 3
Hard: 7
Showing 19 of 19 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
String Matching LeetCode Problems List
- 572. Subtree of Another Tree - Easy - String MatchingGiven the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and... Topics: Tree, Depth-First Search, String Matching, Binary Tree, Hash Function
- 28. Find the Index of the First Occurrence in a String - Easy - String MatchingGiven two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.... Topics: Two Pointers, String, String Matching
- 3684. Substring Matching Pattern - Easy - String MatchingYou are given a string s and a pattern string p, where p contains exactly one '*' character. The '*' in p can be replaced with any sequence of zero or... Topics: String, String Matching
- 214. Shortest Palindrome - Hard - String MatchingYou are given a string s. You can convert s to a palindrome by adding characters in front of it. Return the shortest palindrome you can find by perfor... Topics: String, Rolling Hash, String Matching, Hash Function
- 1508. Longest Happy Prefix - Hard - String MatchingA string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself). Given a string s, return the longest happy prefi... Topics: String, Rolling Hash, String Matching, Hash Function
- 686. Repeated String Match - Medium - String MatchingGiven 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 fo... Topics: String, String Matching
- 812. Rotate String - Easy - String MatchingGiven two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftm... Topics: String, String Matching
- 459. Repeated Substring Pattern - Easy - String MatchingGiven a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.... Topics: String, String Matching
- 3770. Lexicographically Smallest Generated String - Hard - String MatchingYou are given two strings, str1 and str2, of lengths n and m, respectively. A string word of length n + m - 1 is defined to be generated by str1 and s... Topics: String, Greedy, String Matching
- 1080. Camelcase Matching - Medium - String MatchingGiven an array of strings queries and a string pattern, return a boolean array answer where answer[i] is true if queries[i] matches pattern, and false... Topics: Array, Two Pointers, String, Trie, String Matching
- 3303. Find Beautiful Indices in the Given Array II - Hard - String MatchingYou are given a 0-indexed string s, a string a, a string b, and an integer k. An index i is beautiful if: 0 <= i <= s.length - a.length s[i..(i + a.le... Topics: Two Pointers, String, Binary Search, Rolling Hash, String Matching, Hash Function
- 3024. String Transformation - Hard - String MatchingYou are given two strings s and t of equal length n. You can perform the following operation on the string s: Remove a suffix of s of length l where 0... Topics: Math, String, Dynamic Programming, String Matching
- 3580. Find the Occurrence of First Almost Equal Substring - Hard - String MatchingYou are given two strings s and pattern. A string x is called almost equal to y if you can change at most one character in x to make it identical to y... Topics: String, String Matching
- 2292. Counting Words With a Given Prefix - Easy - String MatchingYou are given an array of strings words and a string pref. Return the number of strings in words that contain pref as a prefix. A prefix of a string s... Topics: Array, String, String Matching
- 1566. Check If a Word Occurs As a Prefix of Any Word in a Sentence - Easy - String MatchingGiven a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any word in sentence. R... Topics: Two Pointers, String, String Matching
- 3309. Count Prefix and Suffix Pairs I - Easy - String MatchingYou are given a 0-indexed string array words. Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2: isPrefixAndSuff... Topics: Array, String, Trie, Rolling Hash, String Matching, Hash Function
- 1524. String Matching in an Array - Easy - String MatchingGiven an array of string words, return all strings in words that are a substring of another word. You can return the answer in any order.... Topics: Array, String, String Matching
- 3269. Number of Subarrays That Match a Pattern I - Medium - String MatchingYou are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1. A subarra... Topics: Array, Rolling Hash, String Matching, Hash Function
- 3305. Count Prefix and Suffix Pairs II - Hard - String MatchingYou are given a 0-indexed string array words. Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2: isPrefixAndSuff... Topics: Array, String, Trie, Rolling Hash, String Matching, Hash Function
Related LeetCode Topics
- Array LeetCode Problems
- Backtracking LeetCode Problems
- Biconnected Component LeetCode Problems
- Binary Indexed Tree LeetCode Problems
- Binary Search LeetCode Problems
- Binary Search Tree LeetCode Problems
- Binary Tree LeetCode Problems
- Bit Manipulation LeetCode Problems
- Bitmask LeetCode Problems
- Brainteaser LeetCode Problems
- Breadth-First Search LeetCode Problems
- Bucket Sort LeetCode Problems
- Combinatorics LeetCode Problems
- Concurrency LeetCode Problems
- Counting LeetCode Problems
- Counting Sort LeetCode Problems
- Data Stream LeetCode Problems
- Database LeetCode Problems
- Depth-First Search LeetCode Problems
- Design LeetCode Problems