Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.02 KB

File metadata and controls

39 lines (28 loc) · 1.02 KB

Task 4c4377d9: Vertical Flip Concatenation

Pattern

Vertically flip the grid and concatenate with original.

Output = reversed rows + original rows

Algorithm

  1. Reverse the row order of the input grid (g[::-1])
  2. Concatenate with the original grid (+ g)

Solution (24 bytes)

solve=lambda g:g[::-1]+g

Key Tricks

Trick Description Savings
[::-1] Python slice reversal - no function call needed N/A
+ List concatenation - builds result directly N/A
Lambda Single expression, no return keyword 7 bytes

Byte History

Version Bytes Change
Initial lambda 24 solve=lambda g:g[::-1]+g

Why It's Short

This task has a nearly optimal solution:

  • The operation is a single Python expression
  • No per-element processing needed
  • Slice reversal [::-1] is extremely concise
  • List concatenation + is a single character

At 24 bytes, this is likely near the theoretical minimum for this task.