> I think I got the
> right method but the block is wrong?
>
> a =3D nums1.reject {|x| x<10 && x>21}

A number can't be both less than 10 and greater than 21, so your block
won't match anything in the array.

Replace && with || (or better still, to my eyes, "or").

Also, "reject" seems so _negative_.  Why not be positive? ;)

  nums1.select { |x| (10..21).include? x }

Some other suggestions for your code:

> nums =3D []
> 200.times do
> =A0 nums << rand(100)
> end

  nums =3D (1..200).map { rand(100) }

> nums1 =3D nums.sort
> nums1.each {|n| print n, "," }

You don't really need a new variable, do you?

  nums.sort.each do |n| puts n end

or just

  puts nums.sort


--
Gavin Sinclair