Skip to main content
2 of 2
added 97 characters in body
Jack
  • 131
  • 4

Ruby 2.7.4, 56 54 bytes

->(a,l){a.filter_map.with_index{|_,i|a[i..].index(l)}}

Filter maps over the array and finds the index of the target offset from the current index.

Try it on Replit!

Excited to have gotten my first Golf!

Jack
  • 131
  • 4