There is a list of numbers.
The list is to be divided into 2 equal sized lists, with a minimal difference in sum. The sums have to be printed.
#Example:
>>>que = [2,3,10,5,8,9,7,3,5,2]
>>>make_teams(que)
27 27
Is there an error in th...

Asked By Lakshman Prasad

I am trying to find the longest common subsequence of 3 or more strings. The Wikipedia article has a great description of how to do this for 2 strings, but I'm a little unsure of how to extend this to 3 or more strings.
There are plenty of libraries for ...

Asked By del

For example, let the string be the first 10 digits of pi, 3141592653, and the subsequence be 123. Note that the sequence occurs twice:
3141592653
1 2 3
1 2 3
This was an interview question that I couldn't answer and I can't think of an effici...

Asked By Jake

I was looking for a good solution to the Change-making problem and I found this code(Python):
target = 200
coins = [1,2,5,10,20,50,100,200]
ways = [1]+[0]*target
for coin in coins:
for i in range(coin,target+1):
ways[i]+=ways[i-coin]
print(wa...

Asked By gyosko

Given a target amount and a list of coin denominations, my code is supposed to find the fewest coins needed to reach the target amount.
Examples:
C(78, [1, 5, 10, 25, 50]) = 6
we can make 78 from 3x25 + 3x1, so 6 coins are required
C(48, [1, 7, 24, ...

Asked By user1681664

I'd like to compare 2 strings and keep the matched, splitting off where the comparison fails.
So if I have 2 strings -
string1 = apples
string2 = appleses
answer = apples
Another example, as the string could have more than one word.
string1 = apple...

Asked By NorthSide

I'd like to compare 2 strings and keep the matched, splitting off where the comparison fails.
So if I have 2 strings -
string1 = apples
string2 = appleses
answer = apples
Another example, as the string could have more than one word.
string1 = apple...

Asked By NorthSide

Years ago, I solved a problem via dynamic programming:
https://www.thanassis.space/fillupDVD.html
The solution was coded in Python.
As part of expanding my horizons, I recently started learning OCaml/F#. What better way to test the waters, than by doin...

Asked By ttsiodras

Years ago, I solved a problem via dynamic programming:
https://www.thanassis.space/fillupDVD.html
The solution was coded in Python.
As part of expanding my horizons, I recently started learning OCaml/F#. What better way to test the waters, than by doin...

Asked By ttsiodras

Years ago, I solved a problem via dynamic programming:
https://www.thanassis.space/fillupDVD.html
The solution was coded in Python.
As part of expanding my horizons, I recently started learning OCaml/F#. What better way to test the waters, than by doin...

Asked By ttsiodras