delete_at只接受一个索引.使用内置方法实现这一目标的好方法是什么?不必是一个集合,也可以是一个索引数组.
arr = ["a", "b", "c"] set = Set.new [1, 2] arr.delete_at set # => arr = ["a"]
ruby
ruby ×1