## Longest palindrome subsequence with O(n) space

Given a sequence, find the length of the longest palindromic subsequence in it. Examples: Input : abbaab Output : 4 Input : geeksforgeeks Output :… Read More »

- Optimal Strategy for a Game | Set 2
- Samsung Interview Experience through Co-cubes (2019)
- Maximum sum such that no two elements are adjacent | Set 2
- Longest subsequence such that adjacent elements have at least one common digit
- Bellman Ford Algorithm (Simple Implementation)
- Double Knapsack | Dynamic Programming
- Coin Change | BFS Approach
- Minimum time required to rot all oranges | Dynamic Programming
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Longest path in a directed Acyclic graph | Dynamic Programming
- Minimum number of cubes whose sum equals to given number N
- Maximum sum combination from two arrays
- Count of integers of length N and value less than K such that they contain digits only from the given set
- LCA in a tree using Binary Lifting Technique
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Maximize the happiness of the groups on the Trip
- Count number of ways to reach a given score in a Matrix
- Maximum Sum Subsequence of length k
- Maximum sum path in a matrix from top to bottom and back
- Number of subsets with zero sum
- Distinct palindromic sub-strings of the given string using Dynamic Programming
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Maximum subarray sum by flipping signs of at most K array elements
- Greedy approach vs Dynamic programming
- Iterative approach to print all permutations of an Array
- Divide the array in K segments such that the sum of minimums is maximized
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Minimum steps to delete a string by deleting substring comprising of same characters
- Number of ways to choose elements from the array such that their average is K

Given a sequence, find the length of the longest palindromic subsequence in it. Examples: Input : abbaab Output : 4 Input : geeksforgeeks Output :… Read More »

Given a 2D array(m x n). The task is to check if there is any path from top left to bottom right. In the matrix,… Read More »

The Jacobsthal sequence is an additive sequence similar to the Fibonacci sequence, defined by the recurrence relation Jn = Jn-1 + 2Jn-2, with initial terms… Read More »

Given an Array of Integers and an Integer value k, find out k non-overlapping sub-arrays which have k maximum sums. Examples: Input : arr1[] =… Read More »

Given a n x n matrix of integers. The problem is to find the largest area rectangular sub-matrix having sum divisible by the given value… Read More »

Given a string A, compute the minimum number of characters you need to delete to make resulting string a palindrome. Examples: Input : baca Output… Read More »

A child is running up a staircase with n steps and can hop either 1 step, 2 steps, or 3 steps at a time. Implement… Read More »

Newman-Conway Sequence is the one which generates the following integer sequence. 1 1 2 2 3 4 4 4 5 6 7 7… In mathematical… Read More »

Given an array of numbers, find the maximum product formed by multiplying numbers of an increasing subsequence of that array. Note: A single number is… Read More »

Given n, how many distinct Max Heap can be made from n distinct integers? Examples: Input : n = 3 Output : Assume the integers… Read More »

The Fibonnaci triangle or Hosoya’s triangle is a triangular arrangement of numbers based on Fibonacci numbers. Each number is the sum of two numbers above… Read More »

Given an array arr[] containing n integers. The problem is to count number of increasing subsequences in the array of size k. Examples: Input :… Read More »

Given two natural number n and m. The task is to find the number of ways in which the numbers that are greater than or… Read More »

The Entringer Number E(n, k) are the number of permutations of {1, 2, …, n + 1}, starting with k + 1, which, after initially… Read More »

We are given an infinite two dimensional plane made of hexagons connected together. We can visualize this plane as a honeycomb. Element X is present… Read More »