## XOR of numbers that appeared even number of times in given Range

Given an array of numbers of size N and Q queries. Each query or a range can be represented by L (LeftIndex) and R(RightIndex). Find… Read More »

Given an array of numbers of size N and Q queries. Each query or a range can be represented by L (LeftIndex) and R(RightIndex). Find… Read More »

Given an array A of N integers. You have to answer two types of queries : 1. Update [l, r] – for every i in… Read More »

Given an array of size n. Find the maximum sum an increasing subsequence. Examples: Input : arr[] = { 1, 20, 4, 2, 5 }… Read More »

Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands… Read More »

Given a array ‘a[]’ of size n and number of queries q. Each query can be represented by two integers l and r. Your task… Read More »

Given an array ‘a[]’ and number of queries q. Each query can be represented by l, r, x. Your task is to print the number… Read More »

Given a matrix A of size NxN, we need to find the number of inversion pairs in it. Inversion count in a matrix is defined… Read More »

Let us consider the below problem statement and think of different solutions for it. Given a set S of elements such that the elements are… Read More »

Given an array arr[0..n-1]. The following operations need to be performed. update(l, r, val) : Add ‘val’ to all the elements in the array from… Read More »

ACM ICPC(Association for Computing Machinery – International Collegiate Programming Contest) is a world-wide annual multi-tiered programming contest being organized for over thirteen years. The contest… Read More »

Prerequisites: BIT Given ‘n’ line segments, each of them is either horizontal or vertical, find the maximum number of triangles(including triangles with zero area) that… Read More »

Prerequisites : BIT, DFS Given a rooted tree T, with ‘n’ nodes, each node has a color denoted by the array color[](color[i] denotes the color… Read More »

Prerequisite – Fenwick Tree We know that to answer range sum queries on a 1-D array efficiently, binary indexed tree (or Fenwick Tree) is the… Read More »

Pre-requisite : BIT(Binary Indexed Tree or Fenwick Tree), 2D BIT Given a 2D plane, respond to Q queries, each of the following type: Insert x… Read More »