Update quick-union.rb

Use a range instead of a loop.