Category "dynamic-programming"

Simple algorithm to compute coins that form minimum number of coins (or any valid number of coins) from a limited number of coins

I need to find the coins needed to make up a specified amount, not the number of ways or the minimum number of coins, but if the coins end up a minimal number t

Word Break algorithm

I'm trying to implement the "Word Break" algorithm. Problem: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determin

Is there a way to dynamically create new arrays from a dataframe

I have a table that looks like |Category|number|absorbance|protein1|protein2| |--------|------|----------|--------|--------| |a|int|float|float|float| |a|int|fl

Recursion: Longest Palindrome Substring

This is a very common problem in which we would have to find the longest substring which is also a palindrome substring for the given input string. Now there ar

How to approach this Dynamic Programming Meal Plan Problem?

I came across this problem in a practice interview. I don't want a direct answer, just some help with the intuition of the problem, both your brute force thinki

Longest K Sequential Increasing Subsequences

Why I created a duplicate thread I created this thread after reading Longest increasing subsequence with K exceptions allowed. I realised that the person who wa

Infected Fish can eat another fish having size less that its own. Minimum number of operation required

An evil scientist has developed an injection that induces insatiable hunger in a fish. On giving this injection, a fish of size x can eat another fish of smalle

Dynamic Programming (Codility Q: NumberSolitaire)

This is the question: codility.com/programmers/task/number_solitaire and below link is my result (50% from Codility): https://codility.com/demo/results/trainin

3-PARTITION problem

here is another dynamic programming question (Vazirani ch6) Consider the following 3-PARTITION problem. Given integers a1...an, we want to determine whether it