Given an array arr[] of size N and Q queries of the form [L, R], the task is to find the number of distinct values… Read More

# Category Archives: Competitive Programming

Given a set of strings S and a string patt the task is to autocomplete the string patt to strings from S that have patt… Read More

Given a starting string X of 3 characters, finishing string Y of 3 characters and an array of forbidden strings. The task is to find… Read More

Given two N-digit prime numbers A and B, the task is to find the minimum number of steps taken to convert A to B. Condition… Read More

Given an integer N, the task is to find the N-th Fibonacci numbers. Examples: Input: N = 3 Output: 2 Explanation: F(1) = 1, F(2)… Read More

Given a string consisting of the first N distinct alphabets, the task is to sort the string by using at most N/2 moves. Each move… Read More

Given a number N, the task is to find the minimum number of operations required to reduce the number N to zero by subtracting the… Read More

Given a grid of size N*M consists of 0 and 1 only, the task is to find the length of longest connected 1s in the… Read More

Given an array arr[] of N positive integers and two positive integers S and K, the task is to reach the position of the array… Read More

Given two integers N and K, the task is to find the number of binary strings of length N having an even number of 1’s… Read More

Given a positive integer N, the task is to find the total number of distinct power of prime factor of the given number N. Examples:… Read More