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

Commonmark migration
Source Link

#Python 3, (削除) 145 (削除ここまで)(削除) 141 (削除ここまで) 130 bytes

Python 3, (削除) 145 (削除ここまで)(削除) 141 (削除ここまで) 130 bytes

#Python 3, (削除) 145 (削除ここまで)(削除) 141 (削除ここまで) 130 bytes

Python 3, (削除) 145 (削除ここまで)(削除) 141 (削除ここまで) 130 bytes

added 196 characters in body
Source Link
Erwan
  • 761
  • 5
  • 10

#Python 3, (削除) 145 (削除ここまで) 141(削除) 141 (削除ここまで) 130 bytes

def f(s):l=len(s)-1;a=[ia=[i in"':"for i in s]+[i in".:"for i in s][::-1];return''.join(" '.:"[i+2*j]for i,j in zip([a[-1]]+a[:l]1]]+a,a[l:a[-1][2:len(s)-2:-1]))

The golfed solution use the following property of zip : zip('ABCD', 'xy') --> Ax By so zip(a[:l],a[l:]) can be replace by zip(a,a[l:]) and that allow to remove the definition of l

#Python 3, (削除) 145 (削除ここまで) 141 bytes

def f(s):l=len(s)-1;a=[i in"':"for i in s]+[i in".:"for i in s][::-1];return''.join(" '.:"[i+2*j]for i,j in zip([a[-1]]+a[:l],a[l:-1][::-1]))

#Python 3, (削除) 145 (削除ここまで) (削除) 141 (削除ここまで) 130 bytes

def f(s):a=[i in"':"for i in s]+[i in".:"for i in s][::-1];return''.join(" '.:"[i+2*j]for i,j in zip([a[-1]]+a,a[-2:len(s)-2:-1]))

The golfed solution use the following property of zip : zip('ABCD', 'xy') --> Ax By so zip(a[:l],a[l:]) can be replace by zip(a,a[l:]) and that allow to remove the definition of l

put every thing on the same line
Source Link
Erwan
  • 761
  • 5
  • 10

#Python 3, 145(削除) 145 (削除ここまで) 141 bytes

def f(s):l=len(s)-1
 a=[i1;a=[i in"':"for i in s]+[i in".:"for i in s][::-1]
 return''1];return''.join(" '.:"[i+2*j]for i,j in zip([a[-1]]+a[:l],a[l:-1][::-1]))

#Python 3, 145 bytes

def f(s):l=len(s)-1
 a=[i in"':"for i in s]+[i in".:"for i in s][::-1]
 return''.join(" '.:"[i+2*j]for i,j in zip([a[-1]]+a[:l],a[l:-1][::-1]))

#Python 3, (削除) 145 (削除ここまで) 141 bytes

def f(s):l=len(s)-1;a=[i in"':"for i in s]+[i in".:"for i in s][::-1];return''.join(" '.:"[i+2*j]for i,j in zip([a[-1]]+a[:l],a[l:-1][::-1]))
deleted 9 characters in body
Source Link
mbomb007
  • 23.6k
  • 7
  • 66
  • 143
Loading
added 1187 characters in body
Source Link
Erwan
  • 761
  • 5
  • 10
Loading
Source Link
Erwan
  • 761
  • 5
  • 10
Loading

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