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

126
Vistas
How to list possible repartition of n items in k buckets

I am trying to solve nonograms.

Right now I am trying to solve for overlapping patterns : A 3 long bar in a 5 wide grid will always be at least on the 3rd cell a 2-6 in a 10 wide grid allow to place 1 cell for the 2 bar an 5 cells for the 6 bar

I tried to solve this through permutations, but is is way too inefficient (3M permutation for a 10 wide grid) and there is quite a few rule to reduce the result count :

  • bar order can't be changed
  • there is at least 1 empty cell between 2 bars (you can't merge bars)

I need to find an algorithm to find all different repartitions of empty cells between bars : 2XX2XX2, X2X2XX2, X2X2X2X, etc

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