Ruby - Hashes
How can you swap the first and last elements of an array
arr in Ruby using a single line?arr in Ruby using a single line?arr[0], arr[-1] = arr[-1], arr[0] to swap first and last elements.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions