All Posts

Leetcode 459: Repeated Substring Pattern

Given a string, determine if it can be formed by repeating a substring of itself multiple times.

Leetcode 572: Subtree of Another Tree

Given 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 false otherwise. A subtree of a binary tree consists of a node in the tree and all of this node’s descendants.

Leetcode 686: Repeated String Match

You are given two strings, a and b. You need to find the minimum number of times you should repeat string a so that string b becomes a substring of the repeated a. If it is impossible, return -1.

Leetcode 1023: Camelcase Matching

You are given a list of query strings and a pattern. A query string matches the pattern if you can insert lowercase English letters into the pattern such that it becomes the query string. Each character from the pattern must be placed in order without changing its relative positions, and you may not add any characters that are not in the pattern.

Leetcode 1668: Maximum Repeating Substring

You are given two strings: sequence and word. A string word is considered ‘k-repeating’ in sequence if word concatenated k times forms a substring of sequence. The task is to return the maximum value of k such that word repeated k times appears as a substring in sequence. If no such substring exists, return 0.

Leetcode 1764: Form Array by Concatenating Subarrays of Another Array

Given an array of subarrays groups and a single array nums, your task is to determine whether it is possible to extract each subarray from groups as a contiguous segment from nums. The subarrays must appear in the same order as in groups, and they should be disjoint, meaning no element from nums can belong to more than one subarray. Return true if this is possible, and false otherwise.