Skip to main content
Commonmark migration
Source Link

#MATL, 13 12 bytes

MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

###Explanation

Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % two-output indexing: push digits, then non-digits
         h      % concatenate the two strings
          D     % display

#MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

###Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % two-output indexing: push digits, then non-digits
         h      % concatenate the two strings
          D     % display

MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % two-output indexing: push digits, then non-digits
         h      % concatenate the two strings
          D     % display
deleted 32 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

#MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

###Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % use as index with two-output outputsindexing: push digits, then non-digits
         h      % concatenate the two strings
          D     % display contacatenated string

#MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

###Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % use as index with two outputs: push digits, then non-digits
         h      % concatenate the two strings
          D     % display contacatenated string

#MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

###Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % two-output indexing: push digits, then non-digits
         h      % concatenate the two strings
          D     % display
added 25 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

#MATL, 1313 12 bytes

`jt4Y2m_2$SDT`jt4Y2m&)hDT

Exits with an error (allowed by default), but producesproducing the correct output.

Try it online!Try it online!

###Explanation

`           T    % infinite loop
 j               % input one line as a string
  t              % duplicate
   4Y2           % predefined literal: '0123456789'
      m          % true for elements of string that are digits, false for the rest
       _&)       % use %as negate
index with two outputs: push digits, then non-digits
 2$S      % sort stringh according to whether chars are digits% orconcatenate not
the two strings
          D     % display linecontacatenated string

#MATL, 13 bytes

`jt4Y2m_2$SDT

Exits with an error (allowed by default), but produces the correct output.

Try it online!

###Explanation

`           T    % infinite loop
 j               % input one line as a string
  t              % duplicate
   4Y2           % predefined literal: '0123456789'
      m          % true for elements of string that are digits, false for the rest
       _         % negate
        2$S      % sort string according to whether chars are digits or not
           D     % display line

#MATL, 13 12 bytes

`jt4Y2m&)hDT

Exits with an error (allowed by default), producing the correct output.

Try it online!

###Explanation

`          T    % infinite loop
 j              % input one line as a string
  t             % duplicate
   4Y2          % predefined literal: '0123456789'
      m         % true for elements of string that are digits, false for the rest
       &)       % use as index with two outputs: push digits, then non-digits
         h      % concatenate the two strings
          D     % display contacatenated string
deleted 1 character in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372
Loading
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372
Loading