Dynamic Tree
You are given a tree containing N vertices. The vertices are numbered from 1 to N. A tree with N ver...
Composite Facts
Let's define two functions F and S: F(n) = 1 + n! S(n,m) = Sum of first m non-prime integers which ...
Jenga Tower
Maybe you all are familiar with Jenga Game. "Jenga is played with 54 wooden blocks. Each block is th...
Restore Missing Values
Consider an array of 'N' integers which is indexed from '1' to 'N'. Exactly 'Q' queries numbered fr...
Jontrona of Liakot
Liakot, the king of Cox's Bazar, is currently in a dire situation. His own younger sister Ayesha is ...
Tree Queries
You are given a tree of n vertices. Each vertex contains an integer. Vertex 1 is the root of the tre...
Easy Prime!
There are N numbers in an array. You will have Q queries. In each query, you can make 2 operations. ...
Byang and War Tactics
Byang is learning about War Tactics from Raat, a famous martial arts master, who has successfully tr...
Another Query on String
You are given a string S (of length n) consisting of alphabets only. You need to perform m queries o...
Sofdor Ali and Bracket Sequence
Sofdor Ali has invented a new game. He asked his assistant Jong Bahadur ( who happens to be a monkey...
Data Structure
The operations that are performed in a data structure can be categorized into two types: query and u...
Smallest Subarray
You are given an array A of N integers A1, A2, A3, ..., AN . If we select two indices (1 ≤ i ≤ j ≤ N...
Array Simulation
You are given an array of N elements. Initially all the indices have a value of 0. You have to do fo...
Device ID
A device ID is a distinct number associated with a smartphone or similar handheld device. Every smar...
Distinctness
A substring of string S is another string S' which occurs in string S. For example: S = aaba and one...
Primary Key
"Clarity-Lon" is the new awesome e-commerce based startup that went to the top of the chart within f...
Rio and Inversion
One day Rio was returning home from his university and unfortunately lost his phone on the way. He a...
Special Pair
Mr. X is an “array pagla” person. He loves doing different types of things with arrays. Today Mr. X ...
Village Fair 2
There are N houses in a village far away from here. They are numbered from 1 to N. For this problem ...
Maintain the Queue
“Ajob Desh” is a strange country. Anyone who wants to buy train tickets need to go to the railway st...
Subset of Sequences
You will be given a set of sequences. Each sequence is a list of numbers. Two sequences are K-simila...
Perseus and The New Challenge
The life of princess Andromeda, the daughter of King Cepheus and Queen Cassiopeia of Ados, is in dan...
Mario and Princess Peach
The world of Mario can be imagined as 2D grid of $N$ rows and $M$ columns--containing a total of $N ...
Final Days of Goldfinger
We see agent Bond once again being called in time of a great need. The vile criminal Auric Goldfinge...
Smart Query Handler
Bit operators perform bit-wise operations between two binary numbers. Wikipedia says, binary operati...
Toph uses cookies. By continuing you agree to our Cookie Policy.