## Maximize the subarray sum after multiplying all elements of any subarray with X

Given an array arr[] of N integers and an integer X. We can choose any sub-array and multiply all its element by X. After multiplication,… 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
- Longest subsequence such that adjacent elements have at least one common digit
- Make Binary Search Tree
- Count ways to reach a score using 1 and 2 with no consecutive 2s
- Memoization using decorators in Python
- Number of ways to partition a string into two balanced subsequences
- Samsung Interview Experience through Co-cubes (2019)
- Treasure and Cities
- Jump Pointer Algorithm
- Color N boxes using M colors such that K boxes have different color from the box on its left
- 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
- Double Knapsack | Dynamic Programming
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Longest path in a directed Acyclic graph | Dynamic Programming
- Maximum subarray sum by flipping signs of at most K array elements
- Count of Numbers in Range where first digit is equal to last digit of the number
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Minimum steps to delete a string by deleting substring comprising of same characters
- Find sub-matrix with the given sum
- 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
- Number of Binary Strings of length N with K adjacent Set Bits

Given an array arr[] of N integers and an integer X. We can choose any sub-array and multiply all its element by X. After multiplication,… Read More »

Given an array arr[] of integers, the task is to find the minimum number greater than the maximum element from the array which cannot be… Read More »

Given a string S. The task is to count the non-overlapping pairs of palindromic sub-strings S1 and S2 such that the strings should be S1[L1…R1]… Read More »

Given a string str and Q queries. Every query consists of two numbers L and R. The task is to print if the sub-string[L…R] is… Read More »

Given an array arr[] of size N. The task is to find the length of the longest subsequence from the given array such that the… Read More »

Given an integer N. The task is to find the number of all possible distinct binary strings of length N which have at least 3… Read More »

Given N which is the size of the N X N spiral matrix of the form: 16 15 14 13 5 4 3 12 6… Read More »

Given a tree with n nodes and a number associated with every node. We can break any edge of the tree which will result in… Read More »

Given an array arr[] of integer elements, the task is to find maximum possible sub-array sum after changing the signs of at most two elements.… Read More »

Given a N-ary tree with a value associated with each node, the task is to choose a subset of these nodes such that sum of… Read More »

Given a binary tree, the task is to find the Lowest Common Ancestor of the given two nodes in the tree. Let G be a… Read More »

Given a N x N matrix mat[][] consisting of non-negative integers, the task is to find the number of ways to reach a given score… Read More »

Given an array arr[] of n integers and an integer k, the task is to find the maximum sum possible for a sub-sequence such that… Read More »

Given an integer N(1<=N<=10^9). The task is to represent N as a sum of the maximum possible number of composite summands and print this maximum… Read More »

Given three integers R, B and W which denote the number of runs, balls and wickets. One can score 0, 1, 2, 3, 6 or… Read More »