Remember this code you did for me ?
The result is o ListBox is like:
300 250 100 50
but What If I would need the index of the amount ? (in an array or another list box doesn matter)
600 400 4,7
300 250 100 50 1,2,3,6
Like that I could know where was the amount. Becasue if there are two same amounts I cannot know wich it tooks...
Private Sub bgw_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) Handles bgw.DoWork
Dim values() As Decimal = DirectCast(e.Argument, Decimal())
For i As Integer = 1 To values.Length
Dim combos As Combinations(Of Decimal)
combos = New Combinations(Of Decimal)(values, i)
Dim matches = From combo In (From _set In combos Select _set) _
Where combo.Sum() = target _
For Each c As Object In matches
For Each solution As Decimal() In solutions
Dim str As String = ""
For Each dec As Decimal In solution
str += dec.ToString() + " "
str = ""