All Posts

Leetcode 2351: First Letter to Appear Twice

Given a string s of lowercase English letters, return the first letter that appears twice.

Leetcode 2397: Maximum Rows Covered by Columns

You are given a binary matrix matrix of size m x n and an integer numSelect. Your goal is to select exactly numSelect distinct columns from the matrix such that you cover as many rows as possible. A row is considered covered if all the 1’s in that row are included in the selected columns. If a row has no 1’s, it is also considered covered.

Leetcode 2401: Longest Nice Subarray

You are given an array nums consisting of positive integers. A subarray of nums is considered nice if the bitwise AND of every pair of elements, that are at different positions in the subarray, is equal to 0. Your task is to return the length of the longest nice subarray. A subarray is a contiguous part of an array, and subarrays of length 1 are always considered nice.

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 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.

Leetcode 2425: Bitwise XOR of All Pairings

You are given two arrays, nums1 and nums2, each consisting of non-negative integers. You need to calculate the XOR of all possible pairings between the integers in nums1 and nums2. The result should be the XOR of all the numbers from this new array formed by XORing every integer in nums1 with every integer in nums2.