All Posts

Leetcode 2406: Divide Intervals Into Minimum Number of Groups

You are given a 2D array of intervals, where each interval is represented as a pair of integers [left, right], denoting an inclusive range. Your task is to divide these intervals into the minimum number of groups such that no two intervals within the same group overlap. Two intervals overlap if there is at least one common number between them.

Leetcode 2410: Maximum Matching of Players With Trainers

You are given two arrays: ‘players’ and ’trainers’. The array ‘players’ represents the abilities of different players, and the array ’trainers’ represents the training capacities of various trainers. A player can be matched with a trainer if the player’s ability is less than or equal to the trainer’s capacity. The goal is to find the maximum number of valid matchings between players and trainers such that each player is matched with at most one trainer and vice versa.

Leetcode 2411: Smallest Subarrays With Maximum Bitwise OR

Given a 0-indexed array of non-negative integers, ’nums’, you need to find the length of the smallest subarray starting at each index that has the maximum possible bitwise OR. For each index ‘i’, find the minimum length subarray nums[i…j] such that the bitwise OR of this subarray equals the maximum OR value possible starting from index ‘i’.

Leetcode 2414: Length of the Longest Alphabetical Continuous Substring

Given a string ’s’ consisting of lowercase English letters, find the length of the longest substring where the characters are consecutive in the alphabet.

Leetcode 2415: Reverse Odd Levels of Binary Tree

Given the root of a perfect binary tree, reverse the values of the nodes at each odd level of the tree. The level of a node is defined as the number of edges along the path from the root to the node. A perfect binary tree is one where all nodes have two children and all leaves are on the same level.

Leetcode 2419: Longest Subarray With Maximum Bitwise AND

Given an integer array nums of size n, find the length of the longest contiguous subarray that has the maximum possible bitwise AND. The bitwise AND of an array is calculated by performing a bitwise AND operation on all the numbers in it.