2419. Longest Subarray With Maximum Bitwise AND
You are given an integer array nums of size n. Consider a non-empty subarray from nums that has the maximum possible bitwise AND. In other words, let k be the maximum value […]
You are given an integer array nums of size n. Consider a non-empty subarray from nums that has the maximum possible bitwise AND. In other words, let k be the maximum value […]
Given an unsorted array arr containingbothpositive and negative numbers. Your task is to create an array of alternate positive and negative numbers without changing the
You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti]. For each query i compute the XOR of
Given a Binary Tree, convert it into its mirror. Examples: Input: 1 / \ 2 3 Output: 3
You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear
Given the head of a linked list, the task is to find the middle. For example, the middle of 1-> 2->3->4->5 is 3. If
A bit flip of a number x is choosing a bit in the binary representation of x and flipping it from either 0 to 1 or 1 to 0. For example, for x = 7, the
Given an array arr containing the lengths of the different ropes, we need to connect these ropes to form one rope. The cost to
Given the head of a linked list head, in which each node contains an integer value. Between every pair of adjacent
Given an array arr of lowercase strings, determine if the strings can be chained together to form a circle.A string X can be chained
You are given two integers m and n, which represent the dimensions of a matrix. You are also given the head of a linked list
Given an array arr containing only 0s, 1s, and 2s. Sort the array in ascending order. Examples: Input: arr[]= [0, 2, 1, 2, 0]