Skip to content

Category Archives: Competitive Programming

Given an array arr[] of N positive integers and a number K, the task is to find the maximum value of bitwise OR of the… Read More
Given a positive integer N, the task is to find the sum of divisors of all the numbers from 1 to N.Examples:  Input: N =… Read More
Given an array arr[] of positive integers. The task is to reverse a subarray to minimize the sum of elements at even places and print… Read More
Given an integer N, the task is to count the number of square-free divisors of the given number. A number is said to be square-free,… Read More
Given an array arr[] of N numbers. We can merge two adjacent numbers into one and the cost of merging the two numbers is equal… Read More
Given a positive integer N, the task is to find the largest integer M such that 0 <= M < N and XOR(M, N) is… Read More
Given an array arr[] consisting of N integers, the task is to to modify the array such that arr[index] = index using minimum number of… Read More
Given an integer K and an array arr[] of N integers, each of which is the first term and common difference of an Arithemetic Progression,… Read More
Given a string S of length N, consisting of only opening ‘(‘ and closing ‘)‘ parenthesis. The task is to find all indices ‘K‘ such… Read More
Given two arrays a[] and b[], both of size N. The task is to count the number of distinct pairs such that (a[i] + a[j]… Read More
Given a binary string s and a number K, the task is to find the maximum number of 0s that can be replaced by 1s… Read More
Given two positive integers L and R, the task is to find out the total number of values between range [L, R] such that the… Read More
Given an undirected non-weighted graph G. For a given node start return the shortest path that is the number of edges from start to all… Read More
Given an undirected graph, the task is to count the maximum number of Bridges between any two vertices of the given graph.Examples:  Input: Graph 1… Read More