in reply to Re: Finding the best option...
in thread Finding the best option...
However neither of those solutions actualy get what the poster asked for unless i'm misunderstanding your explanation.
2 3 5 10 20 target = 29 asc = 2 3 5 10 = 18 distance = 11 desc = 20 5 3 = 28 distance = 2 closest = 20 10 = 30 distance = 1 2 3 4 5 10 20 target = 40 asc = 2 3 4 5 10 = 24 distance = 16 desc = 20 10 5 4 = 39 distance = 1 closest = 20 10 5 3 2 = 40 distance = 0
In both cases that algorithm failes to get the closes match. I don't have a solution so I should probably shut up, but I was curious if i missed something in your explanation, of if that is just solving a similar problem.
|
|---|