Skip to content

Category Archives: Algorithms

Given an array A[] of size N, find the permutation of array A such that the array B[] which is formed by taking the GCD… Read More
Given two integers M and N the task is to construct a binary palindromic string consisting of M occurrences of 0s and N occurrences of… Read More
Given an N×N matrix mat[][] and an integer K, the task is to search K in mat[][] and if found return its indices. Examples: Input:… Read More
Given two arrays of strings A[] and B[] containing only small case letters, the task is to count the number of strings in A[] such… Read More
Given Q queries in the form of a 2D array arr[][] in which every row consists of two numbers L and R which denotes a… Read More
Given an array A[] of N  integers, the task is to calculate the total number of pairs of indices (i, j) satisfying the following conditions… Read More
Given an array of non-negative integers arr[] and an integer K, the task is to minimize the product of array elements by performing at K… Read More
Given a string S of size M consisting of only zeroes (and hence representing the integer 0). Also, given an array A[] of size N… Read More
Given an array arr[] of N integers such that no element is 0 in that array, the task is to find the minimum number of… Read More
Given an array A[] of N integers, the task is to find the number of pairs of indices (1 ≤ i, j ≤ N) in… Read More
Given a string S that consists of only alphanumeric characters and dashes. The string is separated into N + 1 groups by N dashes. Also… Read More
Given two arrays A[] and B[] of the same length N. the task is to find a pair (X, Y) for two numbers Ai (number… Read More
Given a string s of lowercase English alphabets and integer K. the task is to check if each character after increasing their ASCII by K… Read More
Given a binary string S of length N, the task is to find the number of pairs of integers [L, R] 1 ≤ L <… Read More
Given a string S consisting of lower case letters and an integer K, the task is to remove minimum number of letters from the string,… Read More

Start Your Coding Journey Now!