Check which player visits more number of Nodes
Given a tree with N nodes. Two players A and B start from node 1 and node N respectively. A can visit all the adjacent… Read More »
Given a tree with N nodes. Two players A and B start from node 1 and node N respectively. A can visit all the adjacent… Read More »
Before we discuss this topic in detail we would like to know why you are reading this article. There might be a few reasons and… Read More »
Given a range [L, R], the task is to count the numbers which have even number of odd digits and odd number of even digits.… Read More »
Given an array of unique elements, we have to find all the permutation of length L using the elements of the array. Repetition of elements… Read More »
Given an unbalanced bracket sequence of ‘(‘ and ‘)’, convert it into a balanced sequence by adding the minimum number of ‘(‘ at the beginning… Read More »
Given a tree of distinct nodes N with N-1 edges and a pair of nodes P. The task is to find and print the path… Read More »
Given an array arr[] of size N. The task is to find the sum of the digits of all array elements which contains even number… Read More »
Given an integer N. The task is to count the numbers of pairs of integers A and B such that A + B + N… Read More »
Given a tree of N nodes and an integer K, each node is numbered between 1 and N. The task is to find the number… Read More »
Given a directed graph with N vertices and M edges that may contain cycles, the task is to find the lexicographically smallest topological ordering of… Read More »
Given an array arr[] of N integers and an integer K. The task is to find the maximum xor subset of size K of the… Read More »
Given an array arr[] of N integers, the task is to sort the array without changing the position of negative numbers (if any) i.e. the… Read More »
Given two integers X and Y. The task is to find two vertices of an isosceles triangle ABC(right-angled at B) which has one vertex at… Read More »
Given a binary string S, consisting of 0’s and 1’s. You have to accommodate the 0’s and 1’s into the K buckets in such a… Read More »
Given an undirected unweighted graph with N vertices and M edges. The task is to find two disjoint good sets of vertices. A set X… Read More »