## Combinatorics on ordered trees

An ordered tree is an oriented tree in which the children of a node are somehow ordered. It is a rooted tree in which an… Read More »

An ordered tree is an oriented tree in which the children of a node are somehow ordered. It is a rooted tree in which an… Read More »

The sequence first consists of all the odd numbers starting from 1 to n and then remaining even numbers starting 2 up to n. Let’s… Read More »

Given a text and a wildcard pattern, find if wildcard pattern is matched with text. The matching should cover the entire text (not partial text).… Read More »

A Multistage graph is a directed graph in which the nodes can be divided into a set of stages such that all edges are from… Read More »

Given a number n, the task is to find the largest perfect cube that can be formed by deleting minimum digits(possibly 0) from the number.… Read More »

Given a string of brackets, task is to find the number of pairs of brackets involved in a balanced sequence in a given range. Examples… Read More »

Given a integer n, we need to find how many digits remove from the number to make it a perfect square. Examples: Input : 8314… Read More »

Prerequisites: Disjoint Set Data Structure Set Unordered_Map Disjoint Set data structure is used to keeps track of a set of elements partitioned into a number… Read More »

Sum Rule – If a task can be done in one of ways or one of ways, where none of the set of ways is… Read More »

Given an array where each element denotes the number of chocolates corresponding to each station and to move from station i to station i+1, we… Read More »

Given three different types of cups (a[]) and saucers (b[]), and n number of shelves, find if neat arrangement of cups and shelves can be… Read More »

Given a one/two digit timing, calculate the possibilities of occurrence of other timings(including the glowing one) with relevant to glowing segments, assuming some segments may… Read More »

Given a room with square grids having ‘*’ and ‘.’ representing untidy and normal cells respectively. You need to find whether room can be cleaned… Read More »

Every house in the colony has at most one pipe going into it and at most one pipe going out of it. Tanks and taps… Read More »

A geometric progression is a sequence of integers b1, b2, b3, …, where for each i > 1, the respective term satisfies the condition bi… Read More »