Skip to main content
added 51 characters in body
Source Link
DPD-
  • 251
  • 5

Haskell, 61 58 5656 55 bytes

takeWhile(/="">"").evalState(mapM(state.splitAt.(2^))[0..])

Try it online!Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Haskell, 61 58 56 bytes

takeWhile(/="").evalState(mapM(state.splitAt.(2^))[0..])

Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Haskell, 61 58 56 55 bytes

takeWhile(>"").evalState(mapM(state.splitAt.(2^))[0..])

Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

added 154 characters in body
Source Link
DPD-
  • 251
  • 5

Haskell, 61 5858 56 bytes

(takeWhile(/="")).evalState(mapM(state.splitAt.(2^))[0..])

Try it online!Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Haskell, 61 58 bytes

(takeWhile(/="")).evalState(mapM(state.splitAt.(2^))[0..])

Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Haskell, 61 58 56 bytes

takeWhile(/="").evalState(mapM(state.splitAt.(2^))[0..])

Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

added 50 characters in body
Source Link
DPD-
  • 251
  • 5

Haskell, 6161 58 bytes

(takeWhile(/="")).evalState(mapM(state.splitAt)$.(2^)<$>[0)[0..])

Try it online!Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Haskell, 61 bytes

(takeWhile(/="")).evalState(mapM(state.splitAt)$(2^)<$>[0..])

Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Haskell, 61 58 bytes

(takeWhile(/="")).evalState(mapM(state.splitAt.(2^))[0..])

Try it online!

It maps (with state) over the infinite sequence of powers of two. Each map step returns the first n characters of the string in the state and puts the remaining in the state. So giving as initial state the string and stop iterating when the result is the empty string, we obtain the result.

Source Link
DPD-
  • 251
  • 5
Loading