Replace specified matrix elements such that no two adjacent elements are equal
Given a matrix arr[][] of dimensions N * M, consisting of ‘O’ or ‘F’, where ‘O’ denotes obstacles and ‘F’ denotes free spaces, the task… Read More »
Given a matrix arr[][] of dimensions N * M, consisting of ‘O’ or ‘F’, where ‘O’ denotes obstacles and ‘F’ denotes free spaces, the task… Read More »
Given an array arr[] of size N and an integer K, the task is to count the number of subsets from the given array with… Read More »
Given an array arr[] consisting of N positive integers, the task is to generate all distinct subsequences of the array. Examples: Input: arr[] = {1,… Read More »
Given an integer W and an array a[] of size 26 where ai denotes the cost of using the ith alphabet, the task is to… Read More »
Given an array arr[] of size N representing the available denominations and an integer X. The task is to find any combination of the minimum… Read More »
Given an array arr[] of N integers and an integer K, the task is to check if the expression formed for any permutation of the… Read More »
Given two integers N and K, the task is to generate all positive integers with length N having an absolute difference of adjacent digits equal… Read More »
Given an integer, N, the task is to count the number of ways to generate an array, arr[] of consisting of N integers such that… Read More »
Given a numerical string S, the task is to print all the permutations of the string which are divisible by N. Examples: Input: N =… Read More »
Given an N-ary Tree rooted at 1, and an array val[] consisting of weights assigned to every node, and a matrix Q[][], consisting of queries… Read More »
The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other. For example, the… Read More »
Given an integer N, the task is to print all the possible ways in which N can be written as the sum of two or… Read More »
Given a matrix board[][] consisting of the characters K or k, Q or q, B or b, N or n, R or r, and P… Read More »
Given a numeric string S representing a large number, the task is to form a Fibonacci Sequence of at least length 3 from the given… Read More »
Given a weighted, directed graph G, an array V[] consisting of vertices, the task is to find the Minimum Cost Path passing through all the… Read More »