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

4 of 4
deleted 44 characters in body
AnttiP
  • 8k
  • 16
  • 64

Python 3.8 (pre-release), \$L=79\$, \$N\approx255^{1500}\$

-3 bytes thanks to @Jonathan Allan

f=lambda b,s=0,l=0:b and f(b[1:],255*s+b[0],l+1)or s.to_bytes(l-(l>1500),"big")

Try it online!

Python source code can't contain null bytes. This converts the input (bytestring) to base 255 and then back to bytes. After 1500 removes a redundant byte.

AnttiP
  • 8k
  • 16
  • 64

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