Skip to main content
deleted 102 characters in body
Source Link
emanresu A
  • 44.4k
  • 5
  • 101
  • 240

Jelly, 85 bytes

=TḢɗÐƤ¹ƇiÐƤ¹Ƈ

Try it online!Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

    ÐƤ    Map over the suffixes...
---ɗ      Collect three links as a dyad...
 T       i Indices where
=     Find the first index Inputof equalsthe eachother value
  Ḣ       Find the first suchin indexeach
      ¹Ƈ  Filter out zeroes

Jelly, 8 bytes

=TḢɗÐƤ¹Ƈ

Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

    ÐƤ    Map over the suffixes...
---ɗ      Collect three links as a dyad...
 T        Indices where
=         Input equals each value
  Ḣ       Find the first such index
      ¹Ƈ  Filter out zeroes

Jelly, 5 bytes

iÐƤ¹Ƈ

Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

 ÐƤ    Map over the suffixes...
i      Find the first index of the other value in each
   ¹Ƈ  Filter out zeroes
added 45 characters in body
Source Link
emanresu A
  • 44.4k
  • 5
  • 101
  • 240

Jelly, 68 bytes

=TḢɗÐƤ=TḢɗÐƤ¹Ƈ

Try it online!Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

    ÐƤ    Map over the suffixes...
---ɗ      Collect three links as a dyad...
 T        Indices where
=         Input equals each value
  Ḣ       Find the first such index
      ¹Ƈ  Filter out zeroes

Jelly, 6 bytes

=TḢɗÐƤ

Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

    ÐƤ  Map over the suffixes...
---ɗ    Collect three links as a dyad...
 T      Indices where
=       Input equals each value
  Ḣ     Find the first such index

Jelly, 8 bytes

=TḢɗÐƤ¹Ƈ

Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

    ÐƤ    Map over the suffixes...
---ɗ      Collect three links as a dyad...
 T        Indices where
=         Input equals each value
  Ḣ       Find the first such index
      ¹Ƈ  Filter out zeroes
Source Link
emanresu A
  • 44.4k
  • 5
  • 101
  • 240

Jelly, 6 bytes

=TḢɗÐƤ

Try it online!

Returns values 1-indexed. Tack on a for 0-indexed values. Port of my Vyxal answer.

    ÐƤ  Map over the suffixes...
---ɗ    Collect three links as a dyad...
 T      Indices where
=       Input equals each value
  Ḣ     Find the first such index