Skip to main content
-7 bytes thanks @Veskah
Source Link
mazzy
  • 7.2k
  • 2
  • 12
  • 22

Powershell, 7070 63 bytes

$args|% t*y|%{if($_-le$p){$x;rv x}
$x="$x".PadRight($_-65)+($p=$_)}
$x

-7 bytes thanks @Veskah

$args|%{if($_-le$p){$x;rv x}
$x=("$x"|% *ht($_-65))+($p=$_)}
$x

Try it online!

Explanation:

For each character in the splatted argument strings:

  • Output string $x and clear $x value (rv is alias for Remove-Variable), if a code of the current character less or equivalent (-le) to a code of the previous character.
  • Append spaces and the current character to $x, store it to $x. Also it freshes a previous character value.

Output last $x.

Powershell, 70 bytes

$args|% t*y|%{if($_-le$p){$x;rv x}
$x="$x".PadRight($_-65)+($p=$_)}
$x

Explanation:

For each character in argument strings:

  • Output string $x and clear $x value (rv is alias for Remove-Variable), if a code of the current character less or equivalent (-le) to a code of the previous character.
  • Append spaces and the current character to $x, store it to $x. Also it freshes a previous character value.

Output last $x.

Powershell, 70 63 bytes

-7 bytes thanks @Veskah

$args|%{if($_-le$p){$x;rv x}
$x=("$x"|% *ht($_-65))+($p=$_)}
$x

Try it online!

Explanation:

For each character in the splatted argument:

  • Output string $x and clear $x value (rv is alias for Remove-Variable), if a code of the current character less or equivalent (-le) to a code of the previous character.
  • Append spaces and the current character to $x, store it to $x. Also it freshes a previous character value.

Output last $x.

Source Link
mazzy
  • 7.2k
  • 2
  • 12
  • 22

Powershell, 70 bytes

$args|% t*y|%{if($_-le$p){$x;rv x}
$x="$x".PadRight($_-65)+($p=$_)}
$x

Explanation:

For each character in argument strings:

  • Output string $x and clear $x value (rv is alias for Remove-Variable), if a code of the current character less or equivalent (-le) to a code of the previous character.
  • Append spaces and the current character to $x, store it to $x. Also it freshes a previous character value.

Output last $x.