All Posts

Leetcode 1297: Maximum Number of Occurrences of a Substring

Given a string s, return the maximum number of occurrences of any substring that satisfies the following conditions: The number of unique characters in the substring must be less than or equal to maxLetters, and the substring length must be between minSize and maxSize inclusive.

Leetcode 1300: Sum of Mutated Array Closest to Target

Given an integer array arr and a target value target, return the integer value such that when all integers larger than this value are replaced by the value itself, the sum of the array is as close as possible to the target. If there is a tie, return the smallest such integer.

Leetcode 1302: Deepest Leaves Sum

Given the root of a binary tree, return the sum of values of its deepest leaves. The deepest leaves are the nodes found at the lowest level of the tree.

Leetcode 1305: All Elements in Two Binary Search Trees

Given two binary search trees, root1 and root2, return a list containing all the integers from both trees, sorted in ascending order.

Leetcode 1306: Jump Game III

You are given an array of non-negative integers arr and a starting index start. You can jump forward or backward from any index based on the values at the index. Your task is to determine whether you can reach an index with a value of 0.

Leetcode 1310: XOR Queries of a Subarray

You are given an array of positive integers arr and an array of queries. For each query [lefti, righti], calculate the XOR of elements from index lefti to righti (inclusive). Return an array answer where each element corresponds to the XOR result of the respective query.