# Category Archives: Algorithms

Given arrays A[] and B[] of size N and integer M, the task is to find out the minimum operations required to collect a sum… Read More
Given two integers N and X. Find the maximum product of digits of N, such that increment any digit by 1 at most X times… Read More
Given non-negative integers X, Y, and Z for each M query. Given X amount of character ‘A’, Y amount of character ‘B’, and Z amount… Read More
Given integers, L and R, the task is to find the ∑f(x) for all L to R, where f(x) is defined for number as f(x)… Read More
Given m roads and n cars. The cars are numbered from 1 to n. You are also given an array arr[] of size m, each… Read More
C++ #include <iostream> using namespace std;   int main() {       cout << "GFG!";     return 0; } Java public class Main {     public static void… Read More
Given integers X and Y representing X girls and Y boys, the task is to count the number of ways arranging X girls and Y… Read More
In the Lisp programming language, recursion is a commonly used technique for solving problems. Lisp is a functional programming language, which means it is well-suited… Read More
Given integers L and R, the task is to find the number of integers in the range L to R whose bitwise OR of digits… Read More
Given array A[] of size N and integer X, the task is to find the minimum number of operations to make any two elements equal… Read More
Given an array arr[] of size N, the array represents N / 2 coordinates of a rectangle randomly shuffled with its X and Y coordinates.… Read More
Given a number N, the task is to print the first N prime numbers. Examples:  Input: N = 4Output: 2, 3, 5, 7 Input: N… Read More
Given a number N, the task is to check if the number is a prime number or not. Check if given number N is Prime… Read More
Given an array arr[] of size N, with values either 1, 2, or 3. Traverse the array from left to right and before traversal predict… Read More
Given a string str and an integer K, the task is to find the longest string that can be made by deleting letters from the… Read More