## Minimum steps to reach any of the boundary edges of a matrix | Set 1

Given an N X M matrix, where ai, j = 1 denotes the cell is not empty, ai, j = 0 denotes the cell is… Read More »

- Check if a word exists in a grid or not
- Minimum steps to reach any of the boundary edges of a matrix | Set 1
- Sum of XOR of all subarrays
- Count ways to reach a score using 1 and 2 with no consecutive 2s
- Make Binary Search Tree
- Treasure and Cities
- Number of ways to partition a string into two balanced subsequences
- Memoization using decorators in Python
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Jump Pointer Algorithm
- Minimum distance to the end of a grid from source
- Minimum steps required to convert X to Y where a binary matrix represents the possible conversions
- Minimum cost to reach a point N from 0 with two different operations allowed
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Count of Numbers in Range where first digit is equal to last digit of the number
- Count of sub-sets of size n with total element sum divisible by 3
- Minimum sum falling path in a NxN grid
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Ways to place K bishops on an N×N chessboard so that no two attack
- Find sub-matrix with the given sum
- Number of Binary Strings of length N with K adjacent Set Bits
- Find the sum of first N odd Fibonacci numbers
- Minimum Operations to make value of all vertices of the tree Zero
- Number of balanced bracket expressions that can be formed from a string
- Minimum number of operations required to sum to binary string S
- Count of Numbers in a Range where digit d occurs exactly K times
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
- Count the number of special permutations
- Count of Numbers in Range where the number does not contain more than K non zero digits
- Number of Paths of Weight W in a K-ary tree

Given an N X M matrix, where ai, j = 1 denotes the cell is not empty, ai, j = 0 denotes the cell is… Read More »

Given an array arr[] of strings of same length, the task is to count the number of columns to be deleted so that all the… Read More »

Given two positive integers n and k, the task is to count the number of special permutations. A special permutation P is defined as a… Read More »

Given and . The task is to find the number of binary strings of length n out of 2n such that they satisfy f(bit string)… Read More »

Given a K-ary tree, where each node is having K children and each edge has some weight. All the edges i.e. K, that goes from… Read More »

Given a string str comprising of characters (, ), {, }, [, ] and ?. The task is to find the total number of balanced… Read More »

Given two numbers x, y which denotes the number of set bits. Also given is a number C. The task is to print the number… Read More »

Given a N X N matrix consisting of characters. Also given are Q queries, where each query contains a co-ordinate (X, Y). For every query,… Read More »

Given two integers N and K, the task is to find the number of ways to place K bishops on an N × N chessboard… Read More »

Given a number, N. find the sum of first N odd Fibonacci numbers. Note: The answer can be very large so print the answer modulo… Read More »

Given a string ‘S’ consisting of open and closed brackets, the task is find the number of ways in which each character of ‘S’ can… Read More »

Given integers N, P and Q where N denotes the destination position. The task is to move from position 0 to position N with minimum… Read More »

Given n cities: x1, x2, …… xn: each associated with T[i] (treasure) and C[i] (color). You can choose to visit a city or skip it.… Read More »

Recursion is a programming technique where a function calls itself repeatedly till a termination condition is met. Some of the examples where recursion is used… Read More »

A cricket player has to score N runs, with condition he can take either 1 or 2 runs only and consecutive runs should not be… Read More »