Skip to main content
added 9 characters in body
Source Link
totallyhuman
  • 17.3k
  • 3
  • 32
  • 88

Haskell -, 17 23 bytes

flip take['\0'..]

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'..]

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'..])!!)

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

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'..])!!)

Haskell, 17 23 bytes

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'..])!!)
added 165 characters in body
Source Link
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'..])!!)

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'..]

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'..])!!)

added 147 characters in body
Source Link
archaephyrryx
  • 1.1k
  • 8
  • 11

Haskell - 1717 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'..]

Haskell - 17

flip take['\0'..]

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

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'..]

Source Link
archaephyrryx
  • 1.1k
  • 8
  • 11
Loading