Ruby - Enumerable - each_with_index

  • + 0 comments
    First test answer: ["3:panda", "4:tiger", "5:deer"]
    
    def skip_animals(animals, skip)
        animals[skip..-1].each_with_index.map {|v,i| "#{i+skip}:#{v}" }
    end