Skip to main content
1 of 2
Jack
  • 131
  • 4

Ruby 2.7.4, 56 bytes

f=->(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.

Excited to have gotten my first Golf!

Jack
  • 131
  • 4