All Posts

Leetcode 2932: Maximum Strong Pair XOR I

You are given a 0-indexed array ’nums’. A pair of integers ‘x’ and ‘y’ is called a strong pair if it satisfies the condition |x - y| <= min(x, y). Your task is to find two integers from ’nums’ that form a strong pair and have the highest possible bitwise XOR value among all strong pairs in the array. You can pick the same integer twice.

Leetcode 2958: Length of Longest Subarray With at Most K Frequency

You are given an integer array nums and an integer k. The frequency of an element is the number of times it appears in the array. A subarray is called good if the frequency of each element in it is less than or equal to k. Your task is to return the length of the longest good subarray in nums.

Leetcode 2962: Count Subarrays Where Max Element Appears at Least K Times

Given an integer array nums and a positive integer k, count how many subarrays contain the maximum element of the array at least k times.