Exercise 1: Check the Array Equality
Write code to verify whether two arrays are equal.
We'll cover the following
Problem statement
Write a Ruby method to check whether two arrays are equal. To do this, you are first required to perform the following two tasks:
- Task 1: Use the following widget to generate the list of methods supported for an array, in sorted order.
# Start your code here
- Task 2: Select an appropriate method in the generated list that can be used to solve the given problem in the widget under “Try it yourself.”
Example
The following is an example of the problem statement above.
input = [15, 16, 17]
input1 = [15, 16, 17]
result = true
Try it yourself
def equal_arrays(input, input1)# Start your code herereturn resultend