Given arrays Arr[] and Queries[] of size N and an integer K such that (0 ≤ Arr[i], Queries[i] < 2K), the task is to form… Read More
Tag Archives: BIT
Given a string S and an array of strings arr[] of length N and M respectively, the task is to find the string from the… Read More
Given a string str consisting of N lowercase characters and an array Q[][] with each row of the form {l, r} representing a query. For… Read More
Hamming code is an error-correcting code used for detecting and correcting errors in data transmission. It adds redundant bits to the data being transmitted which… Read More
Given an array A[] of size N, the task for each array element is to count the array elements on their right that are smaller… Read More
Given a string str of length N, and Q queries of the following two types: (1 L R K): Find the Kth greatest character (non-distinct)… Read More
Given an array A[], for each element in the array, the task is to find the sum of all the previous elements which are strictly… Read More
Given an array A[ ] consisting of non-negative integers and a matrix Q[ ][ ] consisting of queries of the following two types: (1, l,… Read More
Given an array arr[] of size N and a matrix Q consisting of queries of the following two types: 1 L R : Print the… Read More
Given an integer M which represents an array initially having numbers 1 to M. Also given is a Query array. For every query, search the… Read More
Given an array arr[] of size N and the task is to answer Q queries of the following types: 1 X 0: Append X at… Read More
Given an array arr, the task is to find the length of The Longest Increasing Sequence using Binary Indexed Tree (BIT) Examples: Input: arr =… Read More
Given a Binary Indexed Tree with N nodes except root node 0 (Numbered from 1 to N), Find its diameter. Binary Indexed Tree is a tree… Read More
Given a binary array arr[] and q queries of following types: k: find the index of the kth set bit i.e. kth 1 in the… Read More
Given an array arr[], the task is to count all the pairs whose xor gives the unique prime, i.e. no two pairs should give the… Read More