Skip to content

Category Archives: Competitive Programming

Given two integers N and K, the task is to find the count of N-digit numbers such that the absolute difference of adjacent digits in… Read More
Given n rectangular buildings in a 2-dimensional city, computes the skyline of these buildings, eliminating hidden lines. The main task is to view buildings from… Read More
Given three integers R, C, N, and an array arr[] of size N. The task is to color all cells of a grid of R… Read More
Given two array of N integers arr[] and costArray[], representing removal cost associated with each element. The task is to find the subsequence from the… Read More
Given a string str, the task is to check if that string is a Reverse Bitonic string or not. If the string str is reverse… Read More
Given three integers N, L, and R. The task is to calculate the number of natural numbers in the range [L, R] (both inclusive) which… Read More
Given a string str, the task is to check if the given string is Even-Odd Palindrome or not.  An Even-Odd Palindrome string is defined to… Read More
Given two integers X and Y, find the minimal number with the sum of digits X, which is strictly greater than Y. Examples:  Input: X… Read More
Given an integer array arr[] of size N and an integer K. The task is to find length of longest subsequence whose sum is less… Read More
Given an array arr[] consisting of N integers, the task is to find the start and end indices of the first subarray with a Negative… Read More
Two players are playing a game starting with a number n. In each turn, a player can make any one of the subsequent moves:   Divide… Read More
Given a Binary Tree, the task is to print the nodes that have grandchildren. Examples:  Input:   Output: 20 8 Explanation: 20 and 8 are the grandparents of… Read More
Given two nodes of a binary tree v1 and v2, the task is to check if two nodes are on the same path in a… Read More