Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 4
Gymhgy
  • 8k
  • 12
  • 35

C# (Visual C# Interactive Compiler), 301 bytes

n=>Enumerable.Repeat(Enumerable.Range(1,n.Max(x=>x.Max())),n[0].Count).Aggregate((IEnumerable<IEnumerable<int>>)new[]{new int[0]},(a,b)=>a.SelectMany(x=>b.Select(y=>x.Append(y)))).Single(x=>n.All(l=>{int z=0;var i=x.ToList();var p=l.All(o=>o==i[z++]|o<1);x=x.Skip(1).Select((a,b)=>a+i[b]);return p;}))

Try it online!

Gymhgy
  • 8k
  • 12
  • 35

AltStyle によって変換されたページ (->オリジナル) /