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 Answer

added 4 characters in body
Source Link
Gymhgy
  • 8k
  • 12
  • 35

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

a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.LengthCount?b[y]:0)?9-x:y,9-y<x?9-y:x))

Saved 6 bytes duethanks to @someone

Try it online! Try it online!

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

a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Length?b[y]:0)?9-x:y,9-y<x?9-y:x))

Saved 6 bytes due to @someone

Try it online!

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

a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Count?b[y]:0)?9-x:y,9-y<x?9-y:x))

Saved 6 bytes thanks to @someone

Try it online!

added 27 characters in body
Source Link
Gymhgy
  • 8k
  • 12
  • 35

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

a=>b=>a.Select((x,y)=>Math.Max(Math.Min(9-x,x<(y=y<b.Length?b[y]:0),Math.Min(?9-x:y,9-y<x?9-y:x)))

Try it online! Saved 6 bytes due to @someone

Try it online!

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

a=>b=>a.Select((x,y)=>Math.Max(Math.Min(9-x,y=y<b.Length?b[y]:0),Math.Min(9-y,x)))

Try it online!

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

a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Length?b[y]:0)?9-x:y,9-y<x?9-y:x))

Saved 6 bytes due to @someone

Try it online!

Source Link
Gymhgy
  • 8k
  • 12
  • 35

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

a=>b=>a.Select((x,y)=>Math.Max(Math.Min(9-x,y=y<b.Length?b[y]:0),Math.Min(9-y,x)))

Try it online!

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