## Find the number of primitive roots modulo prime

Given a prime . The task is to count all the primitive roots of . A primitive root is an integer x (1 <= x… Read More »

- What is Competitive Programming and How to Prepare for It?
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Minimum increment or decrement operations required to make the array sorted
- Longest Increasing Subsequence using Longest Common Subsequence Algorithm
- Color all boxes in line such that every M consecutive boxes are unique
- Print nodes having maximum and minimum degrees
- Largest sub-matrix with all equal elements
- Minimize the cost of partitioning an array into K groups
- Maximum length sub-array which satisfies the given conditions
- Find a pair (n,r) in an integer array such that value of nCr is maximum
- Maximize the Expression | Bit Manipulation
- Minimum number of additons to make the string balanced
- Range maximum query using Sparse Table
- Arrow operator -> in C/C++ with Examples

Given a prime . The task is to count all the primitive roots of . A primitive root is an integer x (1 <= x… Read More »

Given an array of size and an integer . Perform the following operations on the given array: If a[i] > M then push a[i] –… Read More »

Given two positive integers n and r where n > r >1. The task is to find the value of f(n)/(f(r)*f(n-r)). F(n) is deined as… Read More »

Given an array of N elements, the task is to check if the array has an element which is equal to the sum of all… Read More »

Given a number N(less than 10^9). The task is to print all the numbers less than N which are having a maximum of 2 unique… Read More »

Given segments as ranges [L, R] where ranges are non-intersecting and non-overlapping. The task is to find all number between 1 to that doesn’t belong… Read More »

Given an integer N, the task is to find two numbers a and b such that a * b = N and a + b… Read More »

Given an array of elements where each element in the array represents the degree ( 0 <= a[i] <= 359 ) at which there is… Read More »

Given a number . Reduce this number to zero by subtracting the number by it’s most significant digit(Left most digit) at every step. The task… Read More »

Given an array of N integers and a number K, the task is to find the length of the smallest subarray in which all the… Read More »

Given a number N, the task is to find the sum of all the multiples of 3 and 7 below N. Note: A number must… Read More »

Given a string str. The task is to count the minimum number of elements to be removed so that pairwise consecutive elements are same Examples:… Read More »

Given a string of length N of lowercase characters containing 0 or more vowels, the task is to find the count of vowels occurred in… Read More »

Given an integer N, below operations can be performed any number of times on N: Multiply N by any positive integer X i.e. N =… Read More »

Given an array arr containing N integer elements, the task is to count the minimum number of elements that need to be changed such that… Read More »