Hola de nuevo
Bien sigo con mis rollos sobre combinatorias >:D me cuesta jejeje
Bueno tengo este codigo
Dim Elementos As IEnumerable(Of Integer) = {1, 3, 4, 5, 8, 13, 34, 55, 84, 99}
Dim EleX As Integer = 0
Dim EleX2 As Integer = 0
ListBox1.Items.Clear() 'Limpia el ListBox
For I1 As Integer = 0 To Elementos.Count - 1 : EleX += 1
For I2 As Integer = EleX To Elementos.Count - 1
For I3 As Integer = EleX To Elementos.Count - 1
If Elementos(I2) <> Elementos(I3) And Elementos(I3) > Elementos(I2) Then
ListBox1.Items.Add(String.Format("{0:00}, {1:00}, {2:00}", Elementos(I1), Elementos(I2), Elementos(I3)))
End If
Next
Next
Next
MessageBox.Show("Combinaciones: " & ListBox1.Items.Count)
esto me entrega los siguientes resultados (pongo solo algunos ya que son 55)
01 03 04
01 03 05
01 03 08
01 03 13 ********* 03 y 13
01 04 34 *********04 y 34
03 05 08
03 05 13 *********03 y 13
lo que quiero es eliminar los que tengan la misma terminación ejemplo los que marco con asterisco llevan dos números donde son iguales la terminación.
Con linq: ya lo tengo Hecho pero necesito saber como hacerlo con este método :)
ejemplo en Liq: por si le sirve a alguien ( Funciona )
Dim Bz986 As IEnumerable(Of Integer) =
(
From Value As Integer In split(12).Concat(split(15).Concat(split(16)))
Where (Value <= MAX AndAlso Value > 0)).Distinct
Dim selectedValues11 As IEnumerable(Of Integer) =
From value As Integer In Bz909
Group By CStr(value).Last Into Group
Select Group.First()
Take(16())
Dim Sl986 As IEnumerable(Of Integer) = Bz986
Dim SM986 As List(Of Integer) = Bz986.Take(16).ToList
SM986.Sort()
Luis