Union of Two Sorted Arrays with Distinct Elements
Given two sorted arrays a[] and b[], where each array contains distinct elements , the task is to return the elements in the union of the two arrays in sorted order. […]
Given two sorted arrays a[] and b[], where each array contains distinct elements , the task is to return the elements in the union of the two arrays in sorted order. […]
You are given two integers n and x. You have to construct an array of positive integers nums of size n where for every 0 <= i < n –
Given an array arr[] such that each element is in the range [0 – 9], find the minimum possible sum of two
You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query n times: Find a non-negative integer k <
Given two strings s1 and s2. Return a minimum number of times s1 has to be repeated such that s2 is a substring of
The bitwise AND of an array nums is the bitwise AND of all integers in nums. For example, for nums = [1, 5, 3], the bitwise
Given anarray, arr[], determine if arr can be split into three consecutive parts such that the sum of each part is equal. If possible,
You are given a 0-indexed array of positive integers nums. In one operation, you can swap any two adjacent elements if they have the same number of set bits. You
Given a binary tree, where every node value is a number. Find the sum of all the numbers that are
You are given a 0-indexed binary string s having an even length. A string is beautiful if it’s possible to partition it into one or more
Given asquare matrix[][]. The task is to rotate it by 90 degrees in clockwise direction without using any extra space. Examples: Input: mat[][]
Given a string word, compress it using the following algorithm: Begin with an empty string comp. While word is not empty, use the following operation: Remove