Skip to main content
deleted 41 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Japt, 11 bytes

Takes input as an array of space delimited strings, outputs a 2D array of integer strings.

ËiEç)¸ÃÕËÔf

Try it (header converts 2D arrays to the required input format) or run all test casesrun all test cases

ËiEç)¸ÃÕËÔf     :Implicit input of array
Ë               :Map each element at 0-based index E
 i              :  Prepend
  Eç            :    E spaces
    )           :  End prepend
     ¸          :  Split on spaces
      Ã         :End map
       Õ        :Transpose
        Ë       :Map
         Ô      :  Reverse
          f     :  Filter

Japt, 11 bytes

Takes input as an array of space delimited strings, outputs a 2D array of integer strings.

ËiEç)¸ÃÕËÔf

Try it (header converts 2D arrays to the required input format) or run all test cases

ËiEç)¸ÃÕËÔf     :Implicit input of array
Ë               :Map each element at 0-based index E
 i              :  Prepend
  Eç            :    E spaces
    )           :  End prepend
     ¸          :  Split on spaces
      Ã         :End map
       Õ        :Transpose
        Ë       :Map
         Ô      :  Reverse
          f     :  Filter

Japt, 11 bytes

Takes input as an array of space delimited strings, outputs a 2D array of integer strings.

ËiEç)¸ÃÕËÔf

Try it (header converts 2D arrays to the required input format) or run all test cases

ËiEç)¸ÃÕËÔf     :Implicit input of array
Ë               :Map each element at 0-based index E
 i              :  Prepend
  Eç            :    E spaces
    )           :  End prepend
     ¸          :  Split on spaces
      Ã         :End map
       Õ        :Transpose
        Ë       :Map
         Ô      :  Reverse
          f     :  Filter
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Japt, 11 bytes

Takes input as an array of space delimited strings, outputs a 2D array of integer strings.

ËiEç)¸ÃÕËÔf

Try it (header converts 2D arrays to the required input format) or run all test cases

ËiEç)¸ÃÕËÔf     :Implicit input of array
Ë               :Map each element at 0-based index E
 i              :  Prepend
  Eç            :    E spaces
    )           :  End prepend
     ¸          :  Split on spaces
      Ã         :End map
       Õ        :Transpose
        Ë       :Map
         Ô      :  Reverse
          f     :  Filter