# Category Archives: Competitive Programming

## Buy minimum items without change and given coins

You have an unlimited number of 10-rupee coins and exactly one coin of r rupee and you need to buy minimum items each of cost… Read More »

## Count of Numbers in a Range divisible by m and having digit d in even positions

Given a range represented by two positive integers l and r and two integers d and m. Find the count of numbers lying in the… Read More »

## Minimize the maximum minimum difference after one removal from array

Given an array arr[] of size n ≥ 3, the task is to find the minimum possible difference between the maximum and the minimum element… Read More »

## Check if the given graph represents a Star Topology

Given a graph G, the task is to check if it represents a Star Topology. A Star Topology is the one shown in the image… Read More »

## Check if the given graph represents a Ring Topology

Given a graph G, the task is to check if it represents a Ring Topology. A Ring Topology is the one shown in the image… Read More »

## Reach the numbers by making jumps of two given lengths

Given integers k, d1, d2 and an integer array arr[]. Starting from number k you are allowed to make jumps of size d1 and d2… Read More »

## Count of Numbers in Range where the number does not contain more than K non zero digits

Given a range represented by two positive integers L and R and a positive integer K. Find the count of numbers in the range where… Read More »

## Minimum Operations to make value of all vertices of the tree Zero

Given a tree, where each vertex V has a value A[V] stored in it. The task is to find the minimum number of operations required… Read More »

## Number of array elements derivable from D after performing certain operations

Given an array of N integers and 3 integers D, A and B. The task is to find the number of array elements that we… Read More »

## Check if the given graph represents a Bus Topology

Given a graph G, check if it represents a Bus Topology. A Bus Topology is the one shown in the image below: Examples: Input: Output:… Read More »

## Count of Numbers in a Range where digit d occurs exactly K times

Given two positive integers L and R which represents a range and two more positive integers d and K. The task is to find the… Read More »

## Split a string in equal parts such that all parts are palindromes

Given a string str, the task is to split the string into minimum parts such that each part is of same length and each part… Read More »

## Sub-strings that start and end with one character and have at least one other

Given a string str which contains only the characters x and y, the task is to count all the sub-strings that start and end with… Read More »

## Find the maximum possible value of the minimum value of modified array

Given an array of size and a number . The task is to modify the given array such that: The difference between the sum of… Read More »

## Find an integer X which is divisor of all except exactly one element in an array

Given an array of integers. Find an integer X which is the divisor of all except for exactly one element in the given array. Note:… Read More »