Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
Javascript, Given some conditionals, All posible combinations of arrays in an array

I have this array:

[[1, 3, 7][2, 1, 0][2, 5, 4][3, 5, 0][4, 2, 4][4, 5, 7][5, 3, 0][6, 3, 7]]

I want to have all possible combinations of arrays having two conditions:

  1. That the element 0 is never the same
  2. That the element 2 is different, without repetition

My product should be responsive to different inputs of 3 value arrays, and in this case, it should look like this:

[
[[1, 3, 7][2, 1, 0][4, 2, 4]]
[[1, 3, 7][2, 5, 4][3, 5, 0]]
[[1, 3, 7][2, 5, 4][5, 3, 0]]
[[1, 3, 7][3, 5, 0][4, 2, 4]]
... and so on
]

Hope you could understand the issue and give some help.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda