Two Sum – Pair with Given Sum
Given an array arr[] of positive integers and another integer target. Determine if there exists two distinct indices such that the sum of […]
Given an array arr[] of positive integers and another integer target. Determine if there exists two distinct indices such that the sum of […]
There exist two undirected trees with n and m nodes, numbered from 0 to n – 1 and from 0 to m – 1, respectively. You are given two 2D integer arrays edges1 and edges2 of lengths n
Given a strictly sorted 2D matrix mat[][] of size n x m anda number x. Find whether the number x is present in the matrix or not.Note:
You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building. If a person is in building i, they can move
Given a 2D integer matrix mat[][] of size n x m, where every row and column is sorted in increasing order and
You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n – 1]. We
Given a sorted array of distinct positive integers arr[], we need to find the kth positive number that is missing from arr[]. Examples
You are given an integer array prices where prices[i] is the price of the ith item in a shop. There is a special discount for items
You are given an array arr[] of integers, where each element arr[i] represents the number of pages in the ith book. You also have
You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a
You are given an array with unique elements of stalls[],which denote the position of a stall. You are also given an
Given two sorted arrays a[] and b[] and an element k, the task is to find the element that would be at the kth position of the