Skip to main content
3 of 4
added 165 characters in body
archaephyrryx
  • 1.1k
  • 8
  • 11

Haskell - 17 23

flip take['\0'..]

Not sure if it is possible to do any better without imports.

Edit

My first solution didn't actually print the result, so allow 6 more chars for that:

print.flip take['\0'..]

Also, not shorter (25 chars with printing, 19 without), but an interesting alternate approach (it requires 'Data.List', though):

print.((inits['\0'..])!!)

archaephyrryx
  • 1.1k
  • 8
  • 11