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

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Based on the same principe as my answer answer of Deusovi's challenge Deusovi's challenge

Based on the same principe as my answer of Deusovi's challenge

Based on the same principe as my answer of Deusovi's challenge

added 69 characters in body
Source Link
Erwan
  • 761
  • 5
  • 10
 pad with 0 transpose remove 0 reverse even line concatenate with even index
1 2 3 1 2 3 0 0 1 0 0 1 1 
4 5 6 --> 0 4 5 6 0 --> 2 4 0 --> 2 4 --> 2 4 --> 1 2 4 7 5 3 6 8 9
7 8 9 0 0 7 8 9 3 5 7 3 5 7 7 5 3 
 0 6 8 6 8 6 8 
 0 0 9 9 9
 pad with 0 transpose remove 0 reverse even line concatenate 
1 2 3 1 2 3 0 0 1 0 0 1 1 
4 5 6 --> 0 4 5 6 0 --> 2 4 0 --> 2 4 --> 2 4 --> 1 2 4 7 5 3 6 8 9
7 8 9 0 0 7 8 9 3 5 7 3 5 7 7 5 3 
 0 6 8 6 8 6 8 
 0 0 9 9 9
 pad with 0 transpose remove 0 reverse line concatenate with even index
1 2 3 1 2 3 0 0 1 0 0 1 1 
4 5 6 --> 0 4 5 6 0 --> 2 4 0 --> 2 4 --> 2 4 --> 1 2 4 7 5 3 6 8 9
7 8 9 0 0 7 8 9 3 5 7 3 5 7 7 5 3 
 0 6 8 6 8 6 8 
 0 0 9 9 9
replace the sum function by a better use of list comprehension
Source Link
Erwan
  • 761
  • 5
  • 10

Python 3, (削除) 131 (削除ここまで) (削除) 118 (削除ここまで) 115(削除) 115 (削除ここまで) 107 bytes

e=enumerate
lambda s:sum([[k[k for k in i if k][::j%2*2-1]for j,i in e(zip(*[([0]*n+i+[0]*len(s))for n,i in e(s)]))])for k in i[::j%2*2-1]if k]

Python 3, (削除) 131 (削除ここまで) (削除) 118 (削除ここまで) 115 bytes

e=enumerate
lambda s:sum([[k for k in i if k][::j%2*2-1]for j,i in e(zip(*[([0]*n+i+[0]*len(s))for n,i in e(s)]))])

Python 3, (削除) 131 (削除ここまで) (削除) 118 (削除ここまで) (削除) 115 (削除ここまで) 107 bytes

e=enumerate
lambda s:[k for j,i in e(zip(*[([0]*n+i+[0]*len(s))for n,i in e(s)]))for k in i[::j%2*2-1]if k]
clarify Result + use sum to cat array + lambda function + explanation
Source Link
Erwan
  • 761
  • 5
  • 10
Loading
clarify Result + use sum to cat array + lambda function
Source Link
Erwan
  • 761
  • 5
  • 10
Loading
clarify Result
Source Link
Erwan
  • 761
  • 5
  • 10
Loading
Source Link
Erwan
  • 761
  • 5
  • 10
Loading

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